refactored show-page comment cuke to be like normal comment cuke
This commit is contained in:
parent
f86aab3fe2
commit
118ae2d657
2 changed files with 14 additions and 8 deletions
|
|
@ -15,7 +15,5 @@ When /^I comment "([^"]*)" on "([^"]*)"$/ do |comment_text, post_text|
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I make a show page comment "([^"]*)"$/ do |comment_text|
|
When /^I make a show page comment "([^"]*)"$/ do |comment_text|
|
||||||
find(".label.comment").click
|
comment_on_show_page(comment_text)
|
||||||
fill_in "new-comment-text", :with => comment_text
|
|
||||||
click_button :submit
|
|
||||||
end
|
end
|
||||||
|
|
@ -70,13 +70,21 @@ module PublishingCukeHelpers
|
||||||
wait_for_ajax_to_finish
|
wait_for_ajax_to_finish
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_comment(text)
|
def comment_on_show_page(comment_text)
|
||||||
fill_in "text", :with => text
|
within("#post-interactions") do
|
||||||
|
focus_comment_box(".label.comment")
|
||||||
|
make_comment(comment_text, "new-comment-text")
|
||||||
|
end
|
||||||
|
wait_for_ajax_to_finish
|
||||||
|
end
|
||||||
|
|
||||||
|
def make_comment(text, elem="text")
|
||||||
|
fill_in elem, :with => text
|
||||||
click_button :submit
|
click_button :submit
|
||||||
end
|
end
|
||||||
|
|
||||||
def focus_comment_box
|
def focus_comment_box(elem="a.focus_comment_textarea")
|
||||||
find("a.focus_comment_textarea").click
|
find(elem).click
|
||||||
end
|
end
|
||||||
|
|
||||||
def wait_for_ajax_to_finish(wait_time=15)
|
def wait_for_ajax_to_finish(wait_time=15)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue