-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from zenith19/49297_rspec_trainee_user_control…
…ler_index 49297_rspec_trainee_user_controller_index
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "rails_helper" | ||
|
||
describe UsersController do | ||
let(:user){FactoryGirl.create :user} | ||
before{sign_in user} | ||
|
||
describe "GET index" do | ||
before {get :index} | ||
context "Get index successfully" do | ||
it {expect(response).to be_success} | ||
it {expect(response).to have_http_status :ok} | ||
it {expect(response).to render_template :index} | ||
end | ||
it "populates list of users" do | ||
expect(assigns(:users)).to include user | ||
end | ||
end | ||
end |
This file contains 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