Created
October 15, 2011 15:36
-
-
Save searls/1289719 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe("clicking a show description link", function() { | |
beforeEach(function(){ | |
loadFixtures("two_index_trip.html"); | |
//I recommend against writing assertions in the 'arrange' phase | |
//because if you're test-driving, feedback from the system is all you need to validate your arrangement. | |
//expect($('#description_trip_2')).toBeHidden(); | |
$("#detail_link_trip_2").click(); | |
}); | |
it("shows the trip description", function() { | |
expect($('#description_trip_2')).toBeVisible(); | |
}); | |
it('changes the link action to "Hide"',function(){ | |
expect($('#detail_link_trip_2')).toHaveText("Hide Details"); | |
}); | |
describe('clicking the link again',function(){ | |
beforeEach(function(){ | |
$("#detail_link_trip_2").click(); | |
}); | |
it('hides the description',function(){ | |
expect($('#description_trip_2')).toBeHidden(); | |
}); | |
it('Changes the link action back to "Show"',function(){ | |
expect($('#detail_link_trip_2')).toHaveText("Show Details"); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment