Sha256: b5b94b14e1b0a45504eb0404cd5b8f5fcd7faa436f75e0d51fcc145c2132dcfb

Contents?: true

Size: 777 Bytes

Versions: 6

Compression:

Stored size: 777 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
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
davidtrogers-webrat-0.4.4.2 spec/integration/merb/spec/webrat_spec.rb
diabolo-webrat-0.4.4.1 spec/integration/merb/spec/webrat_spec.rb
diabolo-webrat-0.4.4.2 spec/integration/merb/spec/webrat_spec.rb
diabolo-webrat-0.4.4 spec/integration/merb/spec/webrat_spec.rb
raldred-webrat-0.4.4.2 spec/integration/merb/spec/webrat_spec.rb
sr-webrat-0.4.4.1 spec/integration/merb/spec/webrat_spec.rb