Created
February 17, 2015 23:29
-
-
Save adkron/9821bb437b774bd11562 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
require "test_helper" | |
describe TornamentsController do | |
let(:tornament) { tornaments :one } | |
it "gets index" do | |
get :index | |
assert_response :success | |
assert_not_nil assigns(:tornaments) | |
end | |
it "gets new" do | |
get :new | |
assert_response :success | |
end | |
it "creates tornament" do | |
assert_difference('Tornament.count') do | |
post :create, tornament: { base_entry_fee: tornament.base_entry_fee, city: tornament.city, description: tornament.description, end_date: tornament.end_date, headquarters: tornament.headquarters, name: tornament.name, num_fish_days: tornament.num_fish_days, num_lay_days: tornament.num_lay_days, start_date: tornament.start_date, state: tornament.state, target_species: tornament.target_species } | |
end | |
assert_redirected_to tornament_path(assigns(:tornament)) | |
end | |
it "shows tornament" do | |
get :show, id: tornament | |
assert_response :success | |
end | |
it "gets edit" do | |
get :edit, id: tornament | |
assert_response :success | |
end | |
it "updates tornament" do | |
put :update, id: tornament, tornament: { base_entry_fee: tornament.base_entry_fee, city: tornament.city, description: tornament.description, end_date: tornament.end_date, headquarters: tornament.headquarters, name: tornament.name, num_fish_days: tornament.num_fish_days, num_lay_days: tornament.num_lay_days, start_date: tornament.start_date, state: tornament.state, target_species: tornament.target_species } | |
assert_redirected_to tornament_path(assigns(:tornament)) | |
end | |
it "destroys tornament" do | |
assert_difference('Tornament.count', -1) do | |
delete :destroy, id: tornament | |
end | |
assert_redirected_to tornaments_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment