Skip to content

Commit

Permalink
Update user factory
Browse files Browse the repository at this point in the history
  • Loading branch information
dem4ron committed Dec 2, 2024
1 parent fbacaef commit edfa826
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
email { "#{SecureRandom.hex(4)}@exercism.org" }
name { "User" }
password { "password" }
seniority { :mid }
handle { "handle-#{SecureRandom.hex(4)}" }
accepted_terms_at { Date.new(2016, 12, 25) }
accepted_privacy_policy_at { Date.new(2016, 12, 25) }
Expand Down
14 changes: 7 additions & 7 deletions test/system/flows/student_requests_mentorship_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
include MarkdownEditorHelpers

test "student requests mentorship" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_dismissed_introducer, slug: "track-welcome-modal-#{track.slug}", user:)
create(:user_track, user:, track:)
Expand Down Expand Up @@ -45,7 +45,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "form should be invalid when textarea value doesn't reach min length of 20 characters" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_dismissed_introducer, slug: "track-welcome-modal-#{track.slug}", user:)
create(:user_track, user:, track:)
Expand Down Expand Up @@ -97,7 +97,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "student can not request mentorship for hello-world" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_dismissed_introducer, slug: "track-welcome-modal-#{track.slug}", user:)
create(:user_track, user:, track:)
Expand Down Expand Up @@ -130,7 +130,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "student can not request mentorship for hello world" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_track, user:, track:)
hello_world = create :concept_exercise, track:, slug: "hello-world"
Expand All @@ -152,7 +152,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "student sees required number of completed exercises to request mentorship" do
user = create :user
user = create :user, seniority: :mid
track = create :track, title: "Ruby"
create(:user_track, user:, track:)
create :concept_exercise, track:, slug: "hello-world"
Expand All @@ -168,7 +168,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "student requests mentorship when slots are full" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_track, user:, track:)

Expand All @@ -195,7 +195,7 @@ class StudentRequestsMentorship < ApplicationSystemTestCase
end

test "student edits empty comment" do
user = create :user
user = create :user, seniority: :mid
track = create :track
create(:user_track, user:, track:)

Expand Down

0 comments on commit edfa826

Please sign in to comment.