Sha256: b11a76df65db502ed1a19e80ebdb46b8bc62ccdd5c1ca2a8c389d674de90de48

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require "spec_helper"

describe "Relevance::Tarantula::Form large example" do
  before do
    @tag = Hpricot(<<END)
<form action="/session" method="post">
  <input name="authenticity_token" type="hidden" value="1be0d07c6e13669a87b8f52a3c7e1d1ffa77708d" />
  <input id="email" name="email" size="30" type="text" />
  <input id="password" name="password" size="30" type="password" />
  <input id="remember_me" name="remember_me" type="checkbox" value="1" />
  <input name="commit" type="submit" value="Log in" />
</form>
END
    @form = make_form(@tag.at('form'))
  end
  
  it "has an action" do
    @form.action.should == "/session"
  end
  
  it "has a method" do
    @form.method.should == "post"
  end
  
end

describe "A Relevance::Tarantula::Form" do
  it "defaults method to 'get'" do
    @tag = Hpricot("<form/>")
    @form = make_form(@tag.at('form'))
    @form.method.should == 'get'
  end
end

describe "A Relevance::Tarantula::Form with a hacked _method" do
  before do
    @tag = Hpricot(<<END)
<form action="/foo">
  <input name="authenticity_token" type="hidden" value="1be0d07c6e13669a87b8f52a3c7e1d1ffa77708d" />
  <input id="_method" name="_method" size="30" type="text" value="PUT"/>
</form>
END
    @form = make_form(@tag.at('form'))
  end

  it "has a method" do
    @form.method.should == "put"
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tarantula-0.5.1 spec/relevance/tarantula/form_spec.rb
tarantula-0.5.0 spec/relevance/tarantula/form_spec.rb
tarantula-0.4.3 spec/relevance/tarantula/form_spec.rb
tarantula-0.4.2 spec/relevance/tarantula/form_spec.rb
tarantula-0.4.1 spec/relevance/tarantula/form_spec.rb
tarantula-0.4.0 spec/relevance/tarantula/form_spec.rb