diff --git a/lib/capybara/spec/session/all_spec.rb b/lib/capybara/spec/session/all_spec.rb index b7e05473..9d932af3 100644 --- a/lib/capybara/spec/session/all_spec.rb +++ b/lib/capybara/spec/session/all_spec.rb @@ -7,7 +7,7 @@ Capybara::SpecHelper.spec "#all" do it "should find all elements using the given locator" do expect(@session.all('//p').size).to eq(3) expect(@session.all('//h1').first.text).to eq('This is a test') - expect(@session.all("//input[@id='test_field']").first[:value]).to eq('monkey') + expect(@session.all("//input[@id='test_field']").first.value).to eq('monkey') end it "should return an empty array when nothing was found" do @@ -28,7 +28,7 @@ Capybara::SpecHelper.spec "#all" do context "with css selectors" do it "should find all elements using the given selector" do expect(@session.all(:css, 'h1').first.text).to eq('This is a test') - expect(@session.all(:css, "input[id='test_field']").first[:value]).to eq('monkey') + expect(@session.all(:css, "input[id='test_field']").first.value).to eq('monkey') end it "should find all elements when given a list of selectors" do @@ -39,7 +39,7 @@ Capybara::SpecHelper.spec "#all" do context "with xpath selectors" do it "should find the first element using the given locator" do expect(@session.all(:xpath, '//h1').first.text).to eq('This is a test') - expect(@session.all(:xpath, "//input[@id='test_field']").first[:value]).to eq('monkey') + expect(@session.all(:xpath, "//input[@id='test_field']").first.value).to eq('monkey') end end @@ -47,7 +47,7 @@ Capybara::SpecHelper.spec "#all" do before { Capybara.default_selector = :css } it "should find the first element using the given locator" do expect(@session.all('h1').first.text).to eq('This is a test') - expect(@session.all("input[id='test_field']").first[:value]).to eq('monkey') + expect(@session.all("input[id='test_field']").first.value).to eq('monkey') end end diff --git a/lib/capybara/spec/session/find_button_spec.rb b/lib/capybara/spec/session/find_button_spec.rb index 9e61f216..b1284672 100644 --- a/lib/capybara/spec/session/find_button_spec.rb +++ b/lib/capybara/spec/session/find_button_spec.rb @@ -21,7 +21,7 @@ Capybara::SpecHelper.spec '#find_button' do context "with :exact option" do it "should accept partial matches when false" do - expect(@session.find_button('What an Awesome', :exact => false)[:value]).to eq("awesome") + expect(@session.find_button('What an Awesome', :exact => false).value).to eq("awesome") end it "should not accept partial matches when true" do diff --git a/lib/capybara/spec/session/find_spec.rb b/lib/capybara/spec/session/find_spec.rb index 74d69e7d..a8a67ddd 100644 --- a/lib/capybara/spec/session/find_spec.rb +++ b/lib/capybara/spec/session/find_spec.rb @@ -10,7 +10,7 @@ Capybara::SpecHelper.spec '#find' do it "should find the first element using the given locator" do expect(@session.find('//h1').text).to eq('This is a test') - expect(@session.find("//input[@id='test_field']")[:value]).to eq('monkey') + expect(@session.find("//input[@id='test_field']").value).to eq('monkey') end it "should find the first element using the given locator and options" do @@ -79,7 +79,7 @@ Capybara::SpecHelper.spec '#find' do context "with css selectors" do it "should find the first element using the given locator" do expect(@session.find(:css, 'h1').text).to eq('This is a test') - expect(@session.find(:css, "input[id='test_field']")[:value]).to eq('monkey') + expect(@session.find(:css, "input[id='test_field']").value).to eq('monkey') end it "should support pseudo selectors" do @@ -90,7 +90,7 @@ Capybara::SpecHelper.spec '#find' do context "with xpath selectors" do it "should find the first element using the given locator" do expect(@session.find(:xpath, '//h1').text).to eq('This is a test') - expect(@session.find(:xpath, "//input[@id='test_field']")[:value]).to eq('monkey') + expect(@session.find(:xpath, "//input[@id='test_field']").value).to eq('monkey') end end @@ -197,7 +197,7 @@ Capybara::SpecHelper.spec '#find' do before { Capybara.default_selector = :css } it "should find the first element using the given locator" do expect(@session.find('h1').text).to eq('This is a test') - expect(@session.find("input[id='test_field']")[:value]).to eq('monkey') + expect(@session.find("input[id='test_field']").value).to eq('monkey') end after { Capybara.default_selector = :xpath } end diff --git a/lib/capybara/spec/session/first_spec.rb b/lib/capybara/spec/session/first_spec.rb index c2d31518..dd01e785 100644 --- a/lib/capybara/spec/session/first_spec.rb +++ b/lib/capybara/spec/session/first_spec.rb @@ -6,7 +6,7 @@ Capybara::SpecHelper.spec '#first' do it "should find the first element using the given locator" do expect(@session.first('//h1').text).to eq('This is a test') - expect(@session.first("//input[@id='test_field']")[:value]).to eq('monkey') + expect(@session.first("//input[@id='test_field']").value).to eq('monkey') end it "should return nil when nothing was found" do @@ -22,14 +22,14 @@ Capybara::SpecHelper.spec '#first' do context "with css selectors" do it "should find the first element using the given selector" do expect(@session.first(:css, 'h1').text).to eq('This is a test') - expect(@session.first(:css, "input[id='test_field']")[:value]).to eq('monkey') + expect(@session.first(:css, "input[id='test_field']").value).to eq('monkey') end end context "with xpath selectors" do it "should find the first element using the given locator" do expect(@session.first(:xpath, '//h1').text).to eq('This is a test') - expect(@session.first(:xpath, "//input[@id='test_field']")[:value]).to eq('monkey') + expect(@session.first(:xpath, "//input[@id='test_field']").value).to eq('monkey') end end @@ -37,7 +37,7 @@ Capybara::SpecHelper.spec '#first' do before { Capybara.default_selector = :css } it "should find the first element using the given locator" do expect(@session.first('h1').text).to eq('This is a test') - expect(@session.first("input[id='test_field']")[:value]).to eq('monkey') + expect(@session.first("input[id='test_field']").value).to eq('monkey') end end