|
8 | 8 | let(:comment) { Comment.first } |
9 | 9 |
|
10 | 10 | context "when from classic page", page: :classic do |
11 | | - before { click_link "Edit", match: :first } |
12 | | - |
13 | | - context "when edit is submitted" do |
| 11 | + it "comment is updated when edit is submitted" do |
| 12 | + click_link "Edit", match: :first |
14 | 13 | let(:edited_name) { "Abraham Lincoln" } |
15 | 14 |
|
16 | 15 | include_context "when Form Submitted", name: :edited_name |
17 | | - |
18 | | - it "comment is updated" do |
19 | | - expect(page).to have_css(".comment", text: :edited_name) |
20 | | - expect(page).to have_css("#notice", text: "Comment was successfully updated.") |
21 | | - end |
| 16 | + expect(page).to have_css(".comment", text: :edited_name) |
| 17 | + expect(page).to have_css("#notice", text: "Comment was successfully updated.") |
22 | 18 | end |
23 | 19 |
|
24 | | - context "when edit is submitted with blank fields", blank_form_submitted: true do |
25 | | - it "comment is not updated" do |
26 | | - expect(page).not_to have_success_message |
27 | | - expect(page).to have_failure_message |
28 | | - expect(page).not_to have_css(".comment", text: "") |
29 | | - end |
| 20 | + it "comment is not updated when edit is submitted with blank fields", blank_form_submitted: true do |
| 21 | + click_link "Edit", match: :first |
| 22 | + expect(page).not_to have_success_message |
| 23 | + expect(page).to have_failure_message |
| 24 | + expect(page).not_to have_css(".comment", text: "") |
30 | 25 | end |
31 | 26 | end |
32 | 27 | end |
|
0 commit comments