Sha256: 8271e596a2986540cfb4dd2e5ad54e72da290da0fe2cd60870daa43a4c9f49ae

Contents?: true

Size: 865 Bytes

Versions: 14

Compression:

Stored size: 865 Bytes

Contents

shared_context :webapp_fixture do
  require 'sinatra/base'

  let(:rack_app) do
    Class.new(Sinatra::Base) do
      get '/page1' do
        "<html><head><title>page1</title></head><body><a href='/page2'>next page</a></body></html>"
      end

      get '/page2' do
        'page 2 content'
      end

      get '/elements' do
        <<-ELEMENTS
          <a href='#'>a link</a>


          <div id='form' class="form">
            <a id='form_link' href='/page2'>link in a form</a>
            <label>enter text
              <input id='field_id' name='field_name' class='input_class' type='text' value='filled in'/>
            </label>
            <input id='form_button' type='submit' value='a button'/>
          </form>

        ELEMENTS
      end
    end
  end

  before :each do
    Capybara.app = rack_app
  end

  after do
    Capybara.reset!
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
page_magic-1.2.6 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.5 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.5.alpha1 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.4 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.3 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.1 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.2.0 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.1.0 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.4 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.3 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.2 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.1 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.0 spec/support/shared_contexts/webapp_fixture_context.rb
page_magic-1.0.0.alpha21 spec/support/shared_contexts/webapp_context.rb