2012-09-10 17:35:03 +02:00
|
|
|
module SharedNote
|
|
|
|
include Spinach::DSL
|
|
|
|
|
2013-01-14 23:55:02 +01:00
|
|
|
Given 'I delete a comment' do
|
2013-01-15 12:37:20 +01:00
|
|
|
sleep 1
|
2013-01-14 23:55:02 +01:00
|
|
|
first(".js-note-delete").trigger("click")
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I haven\'t written any comment text' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
fill_in "note[note]", with: ""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-10 17:35:03 +02:00
|
|
|
Given 'I leave a comment like "XML attached"' do
|
2013-01-14 23:55:02 +01:00
|
|
|
within(".js-main-target-form") do
|
|
|
|
fill_in "note[note]", with: "XML attached"
|
|
|
|
click_button "Add Comment"
|
2013-01-15 12:37:20 +01:00
|
|
|
sleep 0.05
|
2013-01-14 23:55:02 +01:00
|
|
|
end
|
2012-09-10 17:35:03 +02:00
|
|
|
end
|
|
|
|
|
2013-01-14 23:55:02 +01:00
|
|
|
Given 'I preview a comment text like "Bug fixed :smile:"' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
fill_in "note[note]", with: "Bug fixed :smile:"
|
|
|
|
find(".js-note-preview-button").trigger("click")
|
|
|
|
end
|
2012-09-10 17:35:03 +02:00
|
|
|
end
|
|
|
|
|
2013-01-14 23:55:02 +01:00
|
|
|
Given 'I submit the comment' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
click_button "Add Comment"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I write a comment like "Nice"' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
fill_in "note[note]", with: "Nice"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should not see a comment saying "XML attached"' do
|
|
|
|
page.should_not have_css(".note")
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should not see the cancel comment button' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
should_not have_link("Cancel")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should not see the comment preview' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-preview", visible: false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should not see the comment preview button' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-preview-button", visible: false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should not see the comment text field' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-text", visible: false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see a comment saying "XML attached"' do
|
|
|
|
within(".note") do
|
|
|
|
page.should have_content("XML attached")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see an empty comment text field' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_field("note[note]", with: "")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see the comment edit button' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-edit-button", visible: true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see the comment preview' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-preview", visible: true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see the comment preview button' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
page.should have_css(".js-note-preview-button", visible: true)
|
|
|
|
end
|
|
|
|
end
|
2013-03-19 16:53:21 +01:00
|
|
|
|
|
|
|
Then 'I should see comment "XML attached"' do
|
|
|
|
within(".note") do
|
|
|
|
page.should have_content("XML attached")
|
|
|
|
end
|
|
|
|
end
|
2012-09-10 17:35:03 +02:00
|
|
|
end
|