Skip to content

Commit 738797f

Browse files
committed
background => before
1 parent f67f9a1 commit 738797f

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

spec/system/pages_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "rails_helper"
44

55
shared_examples "Git Commit SHA" do
6-
background { visit root_path }
6+
before { visit root_path }
77
it "displays the current git commit" do
88
el = find("#git-commit-sha")
99
expect(el.text).to eq expected_text

spec/system/shared/contexts.rb

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,33 @@
44

55
# Pages
66
shared_context "when React Router Demo", page: :main do
7-
background { visit root_path }
7+
before { visit root_path }
88
end
99
shared_context "when React Demo", page: :react_demo do
10-
background { visit no_router_path }
10+
before { visit no_router_path }
1111
end
1212
shared_context "when Simple Page", page: :simple do
13-
background { visit simple_path }
13+
before { visit simple_path }
1414
end
1515
shared_context "when Classic Page", page: :classic do
16-
background { visit comments_path }
16+
before { visit comments_path }
1717
end
1818

1919
# Forms
2020
shared_context "when Horizontal Form", form: :horizontal do
21-
background do
22-
# added an extra click on this the non-default link to try to tease out a poltergeist crash
23-
click_link "Inline Form"
24-
expect(page).to have_css("form.commentForm.form-inline")
21+
click_link "Inline Form"
22+
expect(page).to have_css("form.commentForm.form-inline")
2523

26-
click_link "Horizontal Form"
27-
expect(page).to have_css("form.commentForm.form-horizontal")
28-
end
24+
click_link "Horizontal Form"
25+
expect(page).to have_css("form.commentForm.form-horizontal")
2926
end
3027
shared_context "when Inline Form", form: :inline do
31-
background do
32-
click_link "Inline Form"
33-
expect(page).to have_css("form.commentForm.form-inline")
34-
end
28+
click_link "Inline Form"
29+
expect(page).to have_css("form.commentForm.form-inline")
3530
end
3631
shared_context "when Stacked Form", form: :stacked do
37-
background do
38-
click_link "Stacked Form"
39-
expect(page).to have_css("form.commentForm.form-stacked")
40-
end
32+
click_link "Stacked Form"
33+
expect(page).to have_css("form.commentForm.form-stacked")
4134
end
4235

4336
# Form Submission
@@ -47,11 +40,9 @@
4740
let(:name) { name }
4841
let(:text) { text }
4942

50-
background do
51-
fill_in hint_name, with: name
52-
fill_in hint_text, with: text
53-
click_button "Post"
54-
end
43+
fill_in hint_name, with: name
44+
fill_in hint_text, with: text
45+
click_button "Post"
5546
end
5647

5748
shared_context "when Form Submitted with Blank Fields", blank_form_submitted: true do

0 commit comments

Comments
 (0)