mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
Add PagesControllerTest with authentication (#288)
* Add PagesControllerTest with authentication * Rubocop fixes * Move sign_in to setup block * Remove instance variable
This commit is contained in:
parent
d61a22b070
commit
fb7411e163
2 changed files with 15 additions and 0 deletions
12
test/controllers/pages_controller_test.rb
Normal file
12
test/controllers/pages_controller_test.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
require "test_helper"
|
||||
|
||||
class PagesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:bob)
|
||||
end
|
||||
|
||||
test "dashboard" do
|
||||
get root_path
|
||||
assert_response :ok
|
||||
end
|
||||
end
|
|
@ -11,5 +11,8 @@ module ActiveSupport
|
|||
fixtures :all
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
def sign_in(user)
|
||||
post session_path, params: { email: user.email, password: "password" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue