Sha256: 3b55b3ef8f7ecf8e34817a4651cc8fc7739332975c22dd275b7907f4f5d7a3d7

Contents?: true

Size: 967 Bytes

Versions: 54

Compression:

Stored size: 967 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))

describe "Webrat" do
  it "should visit pages" do
    response = visit "/"
    response.should contain("Webrat Form")
  end

  it "should submit forms" do
    visit "/"
    fill_in "Text field", :with => "Hello"
    check "TOS"
    select "January"
    click_button "Test"
  end

  it "should follow internal redirects" do
    response = visit "/internal_redirect"
    response.status.should == 200
    response.should contain("Webrat Form")
  end

  it "should check the value of a field" do
    visit "/"
    field_labeled("Prefilled").value.should == "text"
  end

  it "should not follow external redirects" do
    response = visit "/external_redirect"
    response.status.should == 302
  end

  it "should upload files" do
    visit "/upload"
    attach_file "File", __FILE__
    response = click_button "Upload"
    response.should contain(%(["webrat_spec.rb", "Tempfile"]))
  end
end

Version data entries

54 entries across 54 versions & 21 rubygems

Version Path
diabolo-webrat-0.5.1 spec/integration/merb/spec/webrat_spec.rb
dstrelau-webrat-0.5.1 spec/integration/merb/spec/webrat_spec.rb
emipair-webrat-0.0.1 spec/integration/merb/spec/webrat_spec.rb
hardbap-webrat-0.5.1 spec/integration/merb/spec/webrat_spec.rb
hardbap-webrat-0.5.2 spec/integration/merb/spec/webrat_spec.rb
winton-sum-0.1.0 vendor/webrat/spec/integration/merb/spec/webrat_spec.rb
winton-sum-0.1.1 vendor/webrat/spec/integration/merb/spec/webrat_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/spec/integration/merb/spec/webrat_spec.rb
indirect-webrat-0.7.5 spec/integration/merb/spec/webrat_spec.rb
indirect-webrat-0.7.4 spec/integration/merb/spec/webrat_spec.rb
webrat-0.7.3 spec/integration/merb/spec/webrat_spec.rb
jbd-webrat-0.7.2.rails3 spec/integration/merb/spec/webrat_spec.rb
webrat-0.7.2 spec/integration/merb/spec/webrat_spec.rb
webrat-0.7.2.beta.2 spec/integration/merb/spec/webrat_spec.rb
mutle-webrat-0.7.2.beta.1 spec/integration/merb/spec/webrat_spec.rb
thoughtbot-webrat-0.7.2.pre spec/integration/merb/spec/webrat_spec.rb
webrat-0.7.2.beta.1 spec/integration/merb/spec/webrat_spec.rb
honkster-webrat-0.7.1.2 spec/integration/merb/spec/webrat_spec.rb
honkster-webrat-0.7.1.1 spec/integration/merb/spec/webrat_spec.rb
revo-webrat-0.7.0.1 spec/integration/merb/spec/webrat_spec.rb