add controller tests
This commit is contained in:
Vendored
+2
-2
@@ -1,13 +1,13 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
user: one
|
||||
user: admin_user
|
||||
commentable: one
|
||||
commentable_type: Commentable
|
||||
body: MyText
|
||||
|
||||
two:
|
||||
user: two
|
||||
user: contributor_user
|
||||
commentable: two
|
||||
commentable_type: Commentable
|
||||
body: MyText
|
||||
|
||||
Vendored
+4
-4
@@ -10,8 +10,8 @@ one:
|
||||
de: MyString
|
||||
notes: MyText
|
||||
verified: false
|
||||
created_by: one
|
||||
updated_by: one
|
||||
created_by: admin_user
|
||||
updated_by: admin_user
|
||||
|
||||
two:
|
||||
category: 1
|
||||
@@ -23,5 +23,5 @@ two:
|
||||
de: MyString
|
||||
notes: MyText
|
||||
verified: false
|
||||
created_by: two
|
||||
updated_by: two
|
||||
created_by: contributor_user
|
||||
updated_by: contributor_user
|
||||
|
||||
Vendored
+2
-2
@@ -2,12 +2,12 @@
|
||||
|
||||
one:
|
||||
entry: one
|
||||
user: one
|
||||
user: admin_user
|
||||
changes_made: "{}"
|
||||
change_type: MyString
|
||||
|
||||
two:
|
||||
entry: two
|
||||
user: two
|
||||
user: contributor_user
|
||||
changes_made: "{}"
|
||||
change_type: MyString
|
||||
|
||||
Vendored
+2
-2
@@ -9,7 +9,7 @@ one:
|
||||
source: MyString
|
||||
region: MyString
|
||||
status: :pending
|
||||
submitted_by: one
|
||||
submitted_by: contributor_user
|
||||
|
||||
two:
|
||||
entry: two
|
||||
@@ -20,4 +20,4 @@ two:
|
||||
source: MyString
|
||||
region: MyString
|
||||
status: :pending
|
||||
submitted_by: two
|
||||
submitted_by: contributor_user
|
||||
|
||||
Vendored
+41
-18
@@ -1,23 +1,46 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
# Password for all test users: "password123456"
|
||||
|
||||
one:
|
||||
email: "one@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password') %>
|
||||
name: "User One"
|
||||
role: 1
|
||||
admin_user:
|
||||
email: "admin@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password123456') %>
|
||||
name: "Admin User"
|
||||
role: 2 # admin
|
||||
primary_language: "en"
|
||||
invitation_token: "one"
|
||||
invitation_sent_at: 2026-01-22 13:38:37
|
||||
invitation_accepted_at: 2026-01-22 13:38:37
|
||||
invited_by: one
|
||||
invitation_token: "admin_token_accepted"
|
||||
invitation_sent_at: <%= 30.days.ago %>
|
||||
invitation_accepted_at: <%= 30.days.ago %>
|
||||
invited_by_id: ~
|
||||
|
||||
two:
|
||||
email: "two@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password') %>
|
||||
name: "User Two"
|
||||
role: 1
|
||||
reviewer_user:
|
||||
email: "reviewer@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password123456') %>
|
||||
name: "Reviewer User"
|
||||
role: 1 # reviewer
|
||||
primary_language: "en"
|
||||
invitation_token: "reviewer_token_accepted"
|
||||
invitation_sent_at: <%= 20.days.ago %>
|
||||
invitation_accepted_at: <%= 20.days.ago %>
|
||||
invited_by: admin_user
|
||||
|
||||
contributor_user:
|
||||
email: "contributor@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password123456') %>
|
||||
name: "Contributor User"
|
||||
role: 0 # contributor
|
||||
primary_language: "fi"
|
||||
invitation_token: "two"
|
||||
invitation_sent_at: 2026-01-22 13:38:37
|
||||
invitation_accepted_at: 2026-01-22 13:38:37
|
||||
invited_by: two
|
||||
invitation_token: "contributor_token_accepted"
|
||||
invitation_sent_at: <%= 10.days.ago %>
|
||||
invitation_accepted_at: <%= 10.days.ago %>
|
||||
invited_by: admin_user
|
||||
|
||||
pending_invitation:
|
||||
email: "pending@example.com"
|
||||
password_digest: <%= BCrypt::Password.create('password123456') %>
|
||||
name: "Pending User"
|
||||
role: 0 # contributor
|
||||
primary_language: "en"
|
||||
invitation_token: "pending_token_12345"
|
||||
invitation_sent_at: <%= 2.days.ago %>
|
||||
invitation_accepted_at: ~
|
||||
invited_by: admin_user
|
||||
|
||||
Reference in New Issue
Block a user