Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Fix logic around side solutions rhs
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Oct 12, 2018
1 parent 922eeba commit c0f9fe3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/my/solutions/_show_rhs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-elsif @solution.approved? && [email protected]_approve?
=render "show_approved"

-elsif @solution.exercise.side? && @solution.mentorships.count == 0
-elsif @solution.exercise.side? && @solution.mentorships.count == 0 && @solution.discussion_posts.count == 0 && [email protected]_approve?
.finished-section
.title-block
%h3
Expand Down
2 changes: 1 addition & 1 deletion test/system/my/side_exercises_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class My::SideExercisesTest < ApplicationSystemTestCase

test "mentoring requested" do
@solution.iterations.create
@solution.update(mentoring_requested_at_at: Time.current)
@solution.update(mentoring_requested_at: Time.current)

visit my_track_path(@track)
assert_selector ".pure-u-1-3 .widget-side-exercise.mentoring-requested"
Expand Down
6 changes: 4 additions & 2 deletions test/system/my/solution_discussion_section_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class My::SolutionDiscussionSectionTest < ApplicationSystemTestCase
visit my_solution_path(solution)

assert_selector ".finished-section .next-option strong", text: REQUEST_MENTORING_TEXT
assert_selector ".finished-section .next-option strong", text: COMPLETE_TEXT
refute_selector ".finished-section .next-option strong", text: PUBLISH_TEXT
refute_selector ".finished-section .next-option strong", text: COMPLETE_TEXT

refute_selector ".discussion"
end
Expand All @@ -57,7 +57,9 @@ class My::SolutionDiscussionSectionTest < ApplicationSystemTestCase
assert_selector ".next-steps"
assert_selector ".next-steps a", text: "other people have solved this"

refute_selector ".finished-section"
refute_selector ".finished-section .next-option strong", text: REQUEST_MENTORING_TEXT
refute_selector ".finished-section .next-option strong", text: COMPLETE_TEXT
refute_selector ".finished-section .next-option strong", text: PUBLISH_TEXT
end

test "mentored section with auto approve" do
Expand Down

0 comments on commit c0f9fe3

Please sign in to comment.