diff options
Diffstat (limited to 'qa/spec/page/element_spec.rb')
-rw-r--r-- | qa/spec/page/element_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/qa/spec/page/element_spec.rb b/qa/spec/page/element_spec.rb index 8598c57ad34..5b485c27b3b 100644 --- a/qa/spec/page/element_spec.rb +++ b/qa/spec/page/element_spec.rb @@ -1,51 +1,51 @@ describe QA::Page::Element do - describe '#selector' do - it 'transforms element name into QA-specific selector' do + describe "#selector" do + it "transforms element name into QA-specific selector" do expect(described_class.new(:sign_in_button).selector) - .to eq 'qa-sign-in-button' + .to eq "qa-sign-in-button" end end - describe '#selector_css' do - it 'transforms element name into QA-specific clickable css selector' do + describe "#selector_css" do + it "transforms element name into QA-specific clickable css selector" do expect(described_class.new(:sign_in_button).selector_css) - .to eq '.qa-sign-in-button' + .to eq ".qa-sign-in-button" end end - context 'when pattern is an expression' do + context "when pattern is an expression" do subject { described_class.new(:something, /button 'Sign in'/) } - it 'matches when there is a match' do + it "matches when there is a match" do expect(subject.matches?("button 'Sign in'")).to be true end - it 'does not match if pattern is not present' do + it "does not match if pattern is not present" do expect(subject.matches?("button 'Sign out'")).to be false end end - context 'when pattern is a string' do - subject { described_class.new(:something, 'button') } + context "when pattern is a string" do + subject { described_class.new(:something, "button") } - it 'matches when there is match' do - expect(subject.matches?('some button in the view')).to be true + it "matches when there is match" do + expect(subject.matches?("some button in the view")).to be true end - it 'does not match if pattern is not present' do - expect(subject.matches?('text_field :name')).to be false + it "does not match if pattern is not present" do + expect(subject.matches?("text_field :name")).to be false end end - context 'when pattern is not provided' do + context "when pattern is not provided" do subject { described_class.new(:some_name) } - it 'matches when QA specific selector is present' do - expect(subject.matches?('some qa-some-name selector')).to be true + it "matches when QA specific selector is present" do + expect(subject.matches?("some qa-some-name selector")).to be true end - it 'does not match if QA selector is not there' do - expect(subject.matches?('some_name selector')).to be false + it "does not match if QA selector is not there" do + expect(subject.matches?("some_name selector")).to be false end end end |