Skip to content

Commit

Permalink
it "unassigns the post"
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPrigorshnev committed Mar 6, 2024
1 parent 556700f commit 2a31ae4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions spec/system/assigned_post_popup_menu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
sign_in(admin)
end

it "shows ellipsis button on assigned posts" do
it "shows the more button on assigned posts" do
visit "/t/#{topic.id}"
expect(topic_page).to have_ellipsis_button_on_post(2)
expect(topic_page).to have_more_button_on_post(2)
end

it "unassigns the post" do
visit "/t/#{topic.id}"
# post.click_ellipsis_button
topic_page.click_more_button_on_post(2)
expect(topic_page).to have_more_button_on_post(2)
# post.click_unassign
# expect(popup_menu).to be_closed
# expect(post).to not_have_assigned
Expand Down
8 changes: 6 additions & 2 deletions spec/system/page_objects/pages/topic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ def click_edit_topic_assignment
find("[data-value='reassign']").click
end

def click_more_button_on_post(post_number)
find("article#post_#{post_number} p.assigned-to button.more-button").click
end

def has_assigned?(args)
has_assignment_action?(action: "assigned", **args)
end

def has_ellipsis_button_on_post?(post_number)
page.has_selector?("article#post_#{post_number} p.assigned-to")
def has_more_button_on_post?(post_number)
page.has_selector?("article#post_#{post_number} p.assigned-to button.more-button")
end

def has_unassigned?(args)
Expand Down

0 comments on commit 2a31ae4

Please sign in to comment.