Skip to content

Commit 9898bc2

Browse files
author
Matthew Bellantoni
committed
Get tests passing for StringInput.
1 parent fe2ce8b commit 9898bc2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

spec/support/custom_macros.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def it_should_have_a_nested_ordered_list_with_class(klass)
4646

4747
def it_should_have_label_with_text(string_or_regex)
4848
it "should have a label with text '#{string_or_regex}'" do
49-
output_buffer.should have_tag("form li label", string_or_regex)
49+
output_buffer.should have_tag("form div.control-group label.control-label", string_or_regex)
5050
end
5151
end
5252

5353
def it_should_have_label_for(element_id)
5454
it "should have a label for ##{element_id}" do
55-
output_buffer.should have_tag("form li label.label[@for='#{element_id}']")
55+
output_buffer.should have_tag("form div.control-group label.control-label[@for='#{element_id}']")
5656
end
5757
end
5858

@@ -76,13 +76,13 @@ def it_should_have_select_with_id(element_id)
7676

7777
def it_should_have_input_with_type(input_type)
7878
it "should have a #{input_type} input" do
79-
output_buffer.should have_tag("form li input[@type=\"#{input_type}\"]")
79+
output_buffer.should have_tag("form div.control-group div.controls input[@type=\"#{input_type}\"]")
8080
end
8181
end
8282

8383
def it_should_have_input_with_name(name)
8484
it "should have an input named #{name}" do
85-
output_buffer.should have_tag("form li input[@name=\"#{name}\"]")
85+
output_buffer.should have_tag("form div.control-group div.controls input[@name=\"#{name}\"]")
8686
end
8787
end
8888

@@ -106,8 +106,8 @@ def it_should_have_textarea_with_id(element_id)
106106

107107
def it_should_have_label_and_input_with_id(element_id)
108108
it "should have an input with id '#{element_id}'" do
109-
output_buffer.should have_tag("form li input##{element_id}")
110-
output_buffer.should have_tag("form li label[@for='#{element_id}']")
109+
output_buffer.should have_tag("form div.control-group div.controls input##{element_id}")
110+
output_buffer.should have_tag("form div.control-group label.control-label[@for='#{element_id}']")
111111
end
112112
end
113113

@@ -117,7 +117,7 @@ def it_should_use_default_text_field_size_when_not_nil(as)
117117
concat(semantic_form_for(@new_post) do |builder|
118118
concat(builder.input(:title, :as => as))
119119
end)
120-
output_buffer.should have_tag("form li input[@size='#{Formtastic::FormBuilder.default_text_field_size}']")
120+
output_buffer.should have_tag("form div.control-group div.controls input[@size='#{Formtastic::FormBuilder.default_text_field_size}']")
121121
end
122122
end
123123
end
@@ -128,8 +128,8 @@ def it_should_not_use_default_text_field_size_when_nil(as)
128128
concat(semantic_form_for(@new_post) do |builder|
129129
concat(builder.input(:title, :as => as))
130130
end)
131-
output_buffer.should have_tag("form li input")
132-
output_buffer.should_not have_tag("form li input[@size]")
131+
output_buffer.should have_tag("form div.control-group div.controls input")
132+
output_buffer.should_not have_tag("form div.control-group div.controls input[@size]")
133133
end
134134
end
135135
end
@@ -139,7 +139,7 @@ def it_should_apply_custom_input_attributes_when_input_html_provided(as)
139139
concat(semantic_form_for(@new_post) do |builder|
140140
concat(builder.input(:title, :as => as, :input_html => { :class => 'myclass' }))
141141
end)
142-
output_buffer.should have_tag("form li input.myclass")
142+
output_buffer.should have_tag("form div.control-group div.controls input.myclass")
143143
end
144144
end
145145

@@ -148,14 +148,14 @@ def it_should_apply_custom_for_to_label_when_input_html_id_provided(as)
148148
concat(semantic_form_for(@new_post) do |builder|
149149
concat(builder.input(:title, :as => as, :input_html => { :id => 'myid' }))
150150
end)
151-
output_buffer.should have_tag('form li label[@for="myid"]')
151+
output_buffer.should have_tag('form div.control-group label.control-label[@for="myid"]')
152152
end
153153
end
154154

155155
def it_should_have_maxlength_matching_column_limit
156156
it 'should have a maxlength matching column limit' do
157157
@new_post.column_for_attribute(:title).limit.should == 50
158-
output_buffer.should have_tag("form li input[@maxlength='50']")
158+
output_buffer.should have_tag("form div.control-group div.controls input[@maxlength='50']")
159159
end
160160
end
161161

0 commit comments

Comments
 (0)