Permalink
Browse files

Removed ? from should.include

  • Loading branch information...
1 parent 44ff4e3 commit 88c990772aa0bdfb15aa2cf4937f16386e39a136 @kaineer committed Feb 7, 2011
Showing with 29 additions and 27 deletions.
  1. +1 −1 test/test_hidden.rb
  2. +23 −21 test/test_input.rb
  3. +1 −1 test/test_password.rb
  4. +1 −1 test/test_text.rb
  5. +3 −3 test/test_text_area.rb
View
@@ -8,6 +8,6 @@
end
it "should render with type='hidden' attribute" do
- @input.render.should.include?( "type='hidden'" )
+ @input.render.should.include( "type='hidden'" )
end
end
View
@@ -1,8 +1,10 @@
require 'ream/form'
+include Ream::Form
+
context "default input" do
setup do
- @input = Ream::Form::Input.new
+ @input = Input.new
end
it "should have default text type" do
@@ -14,79 +16,79 @@
end
it "should render open tag" do
- @input.render.should.include?( "<input" )
+ @input.render.should.include( "<input" )
end
it "should render type attribute" do
- @input.render.should.include?( "type='text'" )
+ @input.render.should.include( "type='text'" )
end
it "should render as well-formed tag" do
assert( /^<[^\/]+\/>$/ === @input.render )
end
it "should not include name attributes" do
- @input.render.should.not.include?( "name=" )
+ @input.render.should.not.include( "name=" )
end
end
context "input with name set" do
setup do
- @input = Ream::Form::Input.new( "test_text_input" )
+ @input = Input.new( "test_text_input" )
end
it "should render name attribute" do
- @input.render.should.include?( "name='test_text_input'" )
+ @input.render.should.include( "name='test_text_input'" )
end
end
context "input with value set" do
setup do
- @input = Ream::Form::Input.new( "test_text_input", :text, "test_input_value" )
+ @input = Input.new( "test_text_input", :text, "test_input_value" )
end
it "should render specified value in value attribute" do
- @input.render.should.include?( "value='test_input_value'" )
+ @input.render.should.include( "value='test_input_value'" )
end
end
context "input with id set and no class set" do
setup do
- @input = Ream::Form::Input.new( "text_text_input", :text, :id => "input_id" )
+ @input = Input.new( "text_text_input", :text, :id => "input_id" )
end
it "should have id attribute rendered" do
- @input.render.should.include?( "id='input_id'" )
+ @input.render.should.include( "id='input_id'" )
end
it "should not have class attribute rendered" do
- @input.render.should.not.include?( "class=" )
+ @input.render.should.not.include( "class=" )
end
end
context "input with field set and w/o form" do
setup do
- @input = Ream::Form::Input.new( :test_field )
+ @input = Input.new( :test_field )
end
it "should not render value attribute" do
- @input.render.should.not.include?( "value=" )
+ @input.render.should.not.include( "value=" )
end
it "should not render name attribute" do
- @input.render.should.not.include?( "name=" )
+ @input.render.should.not.include( "name=" )
end
end
context "input in form context" do
setup do
- @form = Ream::Form::Form.new( :object )
- @input = Ream::Form::Input.new( :field )
+ @form = Form.new( :object )
+ @input = Input.new( :field )
@form << @input
end
it "should render name attribute using form and input symbols" do
- @input.render.should.include?( "name='object[field]'" )
+ @input.render.should.include( "name='object[field]'" )
end
end
@@ -101,21 +103,21 @@
@mock.stubs( :field ).returns( "mock_object_field_value" )
- @form = Ream::Form::Form.new( @mock )
- @input = Ream::Form::Input.new( :field )
+ @form = Form.new( @mock )
+ @input = Input.new( :field )
@form << @input
end
it "should render name attribute using object class name" do
- @input.render.should.include?( "name='mock_class_name[field]'" )
+ @input.render.should.include( "name='mock_class_name[field]'" )
end
it "should return form's object value of that field" do
@input.value.should == "mock_object_field_value"
end
it "should render value attribute with value included" do
- @input.render.should.include?( "value='mock_object_field_value'" )
+ @input.render.should.include( "value='mock_object_field_value'" )
end
end
View
@@ -8,6 +8,6 @@
end
it "should render with type='password' attribute" do
- @input.render.should.include?( "type='password'" )
+ @input.render.should.include( "type='password'" )
end
end
View
@@ -8,6 +8,6 @@
end
it "should render with type='text' attribute" do
- @input.render.should.include?( "type='text'" )
+ @input.render.should.include( "type='text'" )
end
end
View
@@ -16,7 +16,7 @@
end
it "should contain no text inside" do
- @textarea.render.should.include?( "><" )
+ @textarea.render.should.include( "><" )
end
end
@@ -26,7 +26,7 @@
end
it "should render name atribute" do
- @textarea.render.should.include?( "name='textarea_name'" )
+ @textarea.render.should.include( "name='textarea_name'" )
end
end
@@ -36,6 +36,6 @@
end
it "should render value between tags" do
- @textarea.render.should.include?( ">textarea_value<" )
+ @textarea.render.should.include( ">textarea_value<" )
end
end

0 comments on commit 88c9907

Please sign in to comment.