Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
split jquery and prototype tests
Browse files Browse the repository at this point in the history
It will help to easier find out which javascript version is not working.
  • Loading branch information
lest committed Jun 4, 2012
1 parent 715079a commit 9f17a16
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions spec/form_spec.rb
Expand Up @@ -2,30 +2,32 @@

describe 'NestedForm' do
include Capybara::DSL

def check_form
page.should have_no_css('form .fields input[id$=name]')
click_link 'Add new task'
page.should have_css('form .fields input[id$=name]', :count => 1)
find('form .fields input[id$=name]').should be_visible
find('form .fields input[id$=_destroy]').value.should == 'false'

click_link 'Remove'
find('form .fields input[id$=_destroy]').value.should == '1'
find('form .fields input[id$=name]').should_not be_visible

click_link 'Add new task'
click_link 'Add new task'
fields = all('form .fields')
fields.select { |field| field.visible? }.count.should == 2
fields.reject { |field| field.visible? }.count.should == 1
end
it 'should work with jQuery and Prototype', :js => true do

it 'should work with jQuery', :js => true do
visit '/projects/new'
check_form

end

it 'should work with Prototype', :js => true do
visit '/projects/new?type=prototype'
check_form
end
end
end

0 comments on commit 9f17a16

Please sign in to comment.