-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e56143c
commit e281bc1
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,25 @@ | ||
require "rails_helper" | ||
include SessionsHelper | ||
|
||
RSpec.describe UsersController, type: :controller do | ||
describe "GET #show" do | ||
let!(:user) { create(:user)} | ||
|
||
context "when user logged in" do | ||
before do | ||
log_in user | ||
get :show, params: { id: user.id } | ||
end | ||
it "render show template" do | ||
expect(response).to render_template(:show) | ||
end | ||
end | ||
|
||
context "when user not logged in" do | ||
it "redirect to login template" do | ||
get :show, params: { id: user.id } | ||
expect(response).to redirect_to login_path | ||
end | ||
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