Skip to content

Instantly share code, notes, and snippets.

@adkron
Created February 17, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adkron/e9e27b17a0362b804087 to your computer and use it in GitHub Desktop.
Save adkron/e9e27b17a0362b804087 to your computer and use it in GitHub Desktop.
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