Sha256: c0851752edcd7f8abdf0648434db9060787f227256cf64f50cf4517c4f6d327a

Contents?: true

Size: 755 Bytes

Versions: 16

Compression:

Stored size: 755 Bytes

Contents

require 'spec_helper'

describe 'LabelHelper' do
  
  include RSpec::Rails::HelperExampleGroup
  include Webrat::HaveTagMatcher
  
  before(:each) do
    @object = mock({
      :errors => {:name => "Invalid name"}
    })
    @object_name = :user
  end
  
  it "should show label tag" do
    helper.jquery_form_for(:new_post, :url => '/hello') do |builder|
      builder.label(:login).should have_tag("label") do |text|
        text.should contain("Login")
      end
    end
  end
  
  it "should show label tag with options" do
    helper.jquery_form_for(:new_post, :url => '/hello') do |builder|
      builder.label(:login, :for => "kuku").should have_tag("label[for='kuku']") do |text|
        text.should contain("Login")
      end
    end
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jquery-ui-form-0.2.8 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.7 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.6 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.5 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.4 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.3 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.2 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.1 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.2.0 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.6 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.5 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.4 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.3 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.2 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.1 spec/helpers/label_helper_spec.rb
jquery-ui-form-0.1.0 spec/helpers/label_helper_spec.rb