Skip to content

Commit fd651ed

Browse files
authored
fixed rspec failure (#64)
1 parent adbd86a commit fd651ed

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

app/controllers/session_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class SessionController < ApplicationController
22

33
skip_before_filter :authenticate, :except => ['destroy']
4+
skip_before_filter :check_existence
45

56
def new
67
id = session[:user_id]
@@ -35,7 +36,7 @@ def create
3536
def destroy
3637
session[:user_id] = nil
3738
session[:is_admin] = nil
38-
redirect_to root_url, notice: "Logged out!"
39+
redirect_to login_path, notice: "Logged out!"
3940
end
4041

4142
end

features/redirect.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Feature: go to the correct page
5050
And I fill in "Password" with "mypassword"
5151
And I press "Log In"
5252
Then I follow "Logout"
53-
Then I should be on the home page
53+
Then I should be on the login page
5454

5555
Scenario: Prevents access to team page when no one is signed in
5656
Given I am on the team "1" page

spec/controllers/admins_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Admin.find_by_id(1).destroy!
2323
get :show, {:id => 1}
24-
response.should redirect_to(login_path)
24+
response.should redirect_to(logout_path)
2525
end
2626
end
2727

spec/controllers/users_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
User.find_by_id(1).destroy!
1313
post :start_team
14-
response.should redirect_to(login_path)
14+
response.should redirect_to(logout_path)
1515
end
1616
end
1717

0 commit comments

Comments
 (0)