Last active
August 29, 2015 14:01
-
-
Save proapi/6cef2d3961929f9c1e11 to your computer and use it in GitHub Desktop.
How to use decent_exposure in tests #rails #tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= render "shared/followed_header" | |
.followed-container | |
= render users |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'users/index.slim', type: :view do | |
it 'displays copyright label' do | |
assign(:users, [create(:user), create(:user)]) | |
render | |
expect(rendered).to include('Obserwuj') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
expose(:users) { User.sort_by_favourites_and_collections_count } | |
def index | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment