Sha256: c6e9d6df01d30ac466634daa379b1332a6e90738a6a1684b506f165aa7a83c0d

Contents?: true

Size: 1002 Bytes

Versions: 17

Compression:

Stored size: 1002 Bytes

Contents

module PageMagic
  describe SessionMethods do
    include_context :webapp_fixture
    let(:session) { PageMagic.session(application: rack_app, url: '/page1') }
    subject do
      OpenStruct.new(session: session).tap do |o|
        o.extend(described_class)
      end
    end

    describe '#execute_script' do
      it 'returns the output of Session#execute_script' do
        expect(session.raw_session).to receive(:execute_script).with(:script).and_return(:result)
        expect(subject.execute_script(:script)).to eq(:result)
      end
    end

    describe '#page' do
      it 'returns the current page of the session' do
        expect(subject.page).to eq(session.current_page)
      end
    end

    describe '#path' do
      it 'returns the path of the session' do
        expect(subject.path).to eq(session.current_path)
      end
    end

    describe '#url' do
      it 'returns the url of the session' do
        expect(subject.url).to eq(session.current_url)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
page_magic-1.2.9 spec/page_magic/session_methods_spec.rb
page_magic-1.2.8 spec/page_magic/session_methods_spec.rb
page_magic-1.2.8.alpha spec/page_magic/session_methods_spec.rb
page_magic-1.2.7 spec/page_magic/session_methods_spec.rb
page_magic-1.2.6 spec/page_magic/session_methods_spec.rb
page_magic-1.2.5 spec/page_magic/session_methods_spec.rb
page_magic-1.2.5.alpha1 spec/page_magic/session_methods_spec.rb
page_magic-1.2.4 spec/page_magic/session_methods_spec.rb
page_magic-1.2.3 spec/page_magic/session_methods_spec.rb
page_magic-1.2.1 spec/page_magic/session_methods_spec.rb
page_magic-1.2.0 spec/page_magic/session_methods_spec.rb
page_magic-1.1.0 spec/page_magic/session_methods_spec.rb
page_magic-1.0.4 spec/page_magic/session_methods_spec.rb
page_magic-1.0.3 spec/page_magic/session_methods_spec.rb
page_magic-1.0.2 spec/page_magic/session_methods_spec.rb
page_magic-1.0.1 spec/page_magic/session_methods_spec.rb
page_magic-1.0.0 spec/page_magic/session_methods_spec.rb