Skip to content

Commit

Permalink
Fix sporadically failing test (#1959)
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Jul 31, 2023
1 parent 6110bf1 commit 59bff97
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions test/system/flows/complete_tutorial_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ class CompleteTutorialTest < ApplicationSystemTestCase
include CapybaraHelpers

test "completes the tutorial succesfully" do
track = create :track
hello_world = create :concept_exercise, track: track, slug: "hello-world"
user = create :user
create :user_track, user: user, track: track
solution = create :concept_solution, user: user, exercise: hello_world
solution = create :hello_world_solution, user: user
submission = create :submission, solution: solution
create :iteration, submission: submission

sign_in!(user)
create :user_track, user: user, track: solution.track

use_capybara_host do
visit track_exercise_url(track, hello_world)
sign_in!(user)

visit track_exercise_url(solution.track, solution.exercise)

click_on "Mark as complete"
find("label", text: "Yes, I'd like to share my solution with the community.").click
click_on "Confirm"
assert_text "You’ve completed “Hello World”"
sleep(2)
assert_text "You’ve completed “Hello, World!”"

click_on "Return to “Hello World”"
assert_text "You've completed Hello World"
click_on "Return to “Hello, World!”"
assert_text "You've completed Hello, World!"
end
end
end
Expand Down

0 comments on commit 59bff97

Please sign in to comment.