Created
July 27, 2010 16:12
-
-
Save rtacconi/492436 to your computer and use it in GitHub Desktop.
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
context "should destroy participation" do | |
setup do | |
@configuration = Factory.create :configuration, :status => 'LIVE' | |
@p = Factory.create :participation, :configuration => @configuration | |
@admin = Factory.create :participant, :admin => true | |
login_as @admin | |
end | |
should "delete :destroy participations" do | |
assert_difference('Participation.count', -1) do | |
delete :destroy, :id => @p.to_param | |
end | |
assert_select "a", "redirected" | |
end | |
end | |
test "should destroy" do | |
@configuration = Factory.create :configuration, :status => 'LIVE' | |
@p = Factory.create :participation, :configuration => @configuration | |
@admin = Factory.create :participant, :admin => true | |
login_as @admin | |
assert_difference('Participation.count', -1) do | |
delete :destroy, :id => @p.to_param | |
end | |
assert_redirected_to(:controller => "configurations", | |
:action => "edit", | |
:id => @configuration.id) | |
assert_equal 'The host has been unassociated.', flash[:notice] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment