Extract method to fill in markdown editor in specs

This commit is contained in:
Javi Martín
2020-06-18 16:08:27 +02:00
parent f8c9f09887
commit f68553dc00
2 changed files with 10 additions and 8 deletions

View File

@@ -55,4 +55,13 @@ module Verifications
within_frame(0) { find("body").set(with) }
end
end
def fill_in_markdown_editor(label, with:)
click_link "Launch text editor"
fill_in label, with: with
within(".fullscreen") do
click_link "Close text editor"
end
end
end

View File

@@ -83,14 +83,7 @@ describe "Admin legislation draft versions" do
click_link "Version 1"
fill_in "Version title", with: "Version 1b"
click_link "Launch text editor"
fill_in "Text", with: "# Version 1 body\r\n\r\nParagraph\r\n\r\n>Quote"
within(".fullscreen") do
click_link "Close text editor"
end
fill_in_markdown_editor "Text", with: "# Version 1 body\r\n\r\nParagraph\r\n\r\n>Quote"
click_button "Save changes"