@ -582,7 +582,7 @@ JJ Abrams</textarea>
end
end
end
end
context 'with ActiveModel and withouth specified label' do
context 'with ActiveModel and without specified label' do
let ( :resource ) {
let ( :resource ) {
FactoryGirl . build_stubbed ( :user ,
FactoryGirl . build_stubbed ( :user ,
firstname : 'JJ' ,
firstname : 'JJ' ,
@ -595,6 +595,18 @@ JJ Abrams</textarea>
it 'uses the human attibute name' do
it 'uses the human attibute name' do
expected_label_like ( User . human_attribute_name ( :name ) )
expected_label_like ( User . human_attribute_name ( :name ) )
end
end
context 'with erroneous field' do
before do
resource . errors . add ( :name , :invalid )
end
it 'shows an appropriate error label' do
expect ( output ) . to have_selector 'label.-error' ,
count : 1 ,
text : User . human_attribute_name ( :name )
end
end
end
end
context 'when required, with a label specified as symbol' do
context 'when required, with a label specified as symbol' do