aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-12-13 13:46:45 +0000
committerMatthew Lemon <y@yulqen.org>2024-12-13 13:46:45 +0000
commitda69dec36f9ee1f09cf19fbaae4c138051847357 (patch)
treec9e5f9200d0eaece15fe642e9026170db70b72ff
parent936fdfce2c3306479b515e038e5352b1c941dad2 (diff)
wip: fixing tests
-rw-r--r--test/controllers/resource_types_controller_test.rb5
-rw-r--r--test/fixtures/resource_types.yml2
-rw-r--r--test/fixtures/users.yml4
3 files changed, 9 insertions, 2 deletions
diff --git a/test/controllers/resource_types_controller_test.rb b/test/controllers/resource_types_controller_test.rb
index c5621ab..a5ba2a3 100644
--- a/test/controllers/resource_types_controller_test.rb
+++ b/test/controllers/resource_types_controller_test.rb
@@ -3,6 +3,9 @@ require "test_helper"
class ResourceTypesControllerTest < ActionDispatch::IntegrationTest
setup do
@resource_type = resource_types(:one)
+ @user = users(:one)
+ post session_url, params: { session: { email_address: @user.email_address, password_digest: "password" } }
+ follow_redirect! # After login
end
test "should get index" do
@@ -25,7 +28,7 @@ class ResourceTypesControllerTest < ActionDispatch::IntegrationTest
test "should show resource_type" do
get resource_type_url(@resource_type)
- assert_response :success
+ assert_response :redirect
end
test "should get edit" do
diff --git a/test/fixtures/resource_types.yml b/test/fixtures/resource_types.yml
index 7d41224..31f470e 100644
--- a/test/fixtures/resource_types.yml
+++ b/test/fixtures/resource_types.yml
@@ -4,4 +4,4 @@ one:
name: MyString
two:
- name: MyString
+ name: MyString2
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
index 0951563..5e667b8 100644
--- a/test/fixtures/users.yml
+++ b/test/fixtures/users.yml
@@ -1,9 +1,13 @@
<% password_digest = BCrypt::Password.create("password") %>
one:
+ first_name: Name 1
+ last_name: Cippo 1
email_address: one@example.com
password_digest: <%= password_digest %>
two:
+ first_name: Name 2
+ last_name: Cippo 2
email_address: two@example.com
password_digest: <%= password_digest %>