Skip to content

Commit

Permalink
Fix devise tests for week 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Arif-Kalluru committed Feb 9, 2023
1 parent 3e1f961 commit f6f238e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

class ActivitiesControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in users(:steve)
@activity = activities(:one)
end

test "should not get index if signed out" do
sign_out users(:steve)
get activities_url
assert_response :redirect
end

test "should get index" do
get activities_url
assert_response :success
Expand Down
2 changes: 2 additions & 0 deletions week_4/activity-tracker/test/fixtures/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
steve:
email: [email protected]
1 change: 1 addition & 0 deletions week_4/activity-tracker/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ class ActiveSupport::TestCase
fixtures :all

# Add more helper methods to be used by all tests here...
include Devise::Test::IntegrationHelpers
end

0 comments on commit f6f238e

Please sign in to comment.