Sha256: a8f81a1f3eb722c0ed4260a37ba3ca9020e9ba35a25fca2d4bafa5a8d1e35946
Contents?: true
Size: 1.7 KB
Versions: 1
Compression:
Stored size: 1.7 KB
Contents
require 'spec_helper' require 'howitzer/capybara/dsl_ex' describe Howitzer::Capybara::DslEx do let(:test_page_klass) do Class.new do include Howitzer::Capybara::DslEx extend Howitzer::Capybara::DslEx end end let(:test_page) { test_page_klass.new } describe "#find" do context "when string argument with block" do subject { test_page.find('foo'){ 'bar' } } it do expect(test_page.page).to receive(:find).with('foo').and_yield.once subject end end context "when first hash argument and second hash" do subject { test_page.find({xpath: '//bar'}, {with: 'foo'}) } it do expect(test_page.page).to receive(:find).with(:xpath, '//bar', {:with=>"foo"}).once subject end end context "when array argument" do subject { test_page.find([:xpath, '//bar']) } it do expect(test_page.page).to receive(:find).with(:xpath, '//bar').once subject end end end describe ".find" do context "when string argument with block" do subject { test_page_klass.find('foo'){ 'bar' } } it do expect(test_page.page).to receive(:find).with('foo').and_yield.once subject end end context "when first hash argument and second hash" do subject { test_page_klass.find({xpath: '//bar'}, {with: 'foo'}) } it do expect(test_page.page).to receive(:find).with(:xpath, '//bar', {:with=>"foo"}).once subject end end context "when array argument" do subject { test_page_klass.find([:xpath, '//bar']) } it do expect(test_page.page).to receive(:find).with(:xpath, '//bar').once subject end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
howitzer-1.0.2 | spec/unit/lib/capybara/dsl_ex_spec.rb |