Skip to content

Commit

Permalink
Expand feature for NUBIC#336 a bit.
Browse files Browse the repository at this point in the history
(I thought I had merged the fix out, but the feature wasn't failing, so I
tried expanding it to get it to fail. Turns out I didn't merge it out, but
no reason not to keep the more detailed scenario.)
  • Loading branch information
rsutphin committed Jul 19, 2012
1 parent 966251c commit 34be47f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions features/step_definitions/surveyor_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,13 @@ def render_context
page.has_css?("select", :count => i)
end

Then /^the checkbox for "(.*?)" should be disabled$/ do |text|
Then /^the checkbox for "(.*?)" should be (dis|en)abled$/ do |text, dis_or_en|
a = Answer.find_by_text(text)
a.should_not be_nil
find("input[value='#{a.id}']")['disabled'].should == "true"
element = find("input[value='#{a.id}']")
if dis_or_en == 'dis'
element['disabled'].should == 'true'
else
element['disabled'].should be_nil
end
end
11 changes: 9 additions & 2 deletions features/surveyor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,13 @@ Feature: Survey creation
end
"""
When I start the "Heat" survey
And I click "No other heating source"
And I click "No other heating source"
Then the checkbox for "Refused" should be disabled
Then the checkbox for "Don't know" should be disabled
And the checkbox for "Don't know" should be disabled
When I uncheck "No other heating source"
Then the checkbox for "Refused" should be enabled
When I check "Electric"
Then the checkbox for "Refused" should be enabled
When I check "Refused"
Then the checkbox for "Electric" should be disabled
And the checkbox for "Don't know" should be disabled

0 comments on commit 34be47f

Please sign in to comment.