Created
July 13, 2011 17:10
-
-
Save zealoushacker/1080768 to your computer and use it in GitHub Desktop.
Credits matcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^student (\d+|\d+..\d+) should have (\d+) less credits$/ do |student_num, num_credits| | |
if student_num =~ /\d+..\d+/ | |
student_num.to_range.each do |s_id| | |
tr_locator = "table#customer_users tbody tr:nth-of-type(#{s_id})" | |
selenium.get_text("css=#{tr_locator} td:nth-of-type(4)").should == (@cu.credits_active - num_credits.to_i).to_s | |
selenium.get_text("css=#{tr_locator} td:nth-of-type(5)").should == (@cu.attended + 1).to_s | |
end | |
else | |
tr_locator = "table#customer_users tbody tr:nth-of-type(#{student_num})" | |
selenium.get_text("css=#{tr_locator} td:nth-of-type(4)").should == (@cu.credits_active - num_credits.to_i).to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment