Skip to content

Commit

Permalink
Remember, we still test against 1.8.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamnet committed Apr 18, 2012
1 parent f14eb34 commit 63c5389
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions app/controllers/players_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def index

respond_to do |format|
format.html # index.html.erb
format.json { render json: @players }
format.json { render :json => @players }
end
end

Expand All @@ -17,7 +17,7 @@ def show

respond_to do |format|
format.html # show.html.erb
format.json { render json: @player }
format.json { render :json => @player }
end
end

Expand All @@ -28,7 +28,7 @@ def new

respond_to do |format|
format.html # new.html.erb
format.json { render json: @player }
format.json { render :json => @player }
end
end

Expand All @@ -44,11 +44,11 @@ def create

respond_to do |format|
if @player.save
format.html { redirect_to @player, notice: 'Player was successfully created.' }
format.json { render json: @player, status: :created, location: @player }
format.html { redirect_to @player, :notice => 'Player was successfully created.' }
format.json { render :json => @player, :status => :created, :location => @player }
else
format.html { render action: "new" }
format.json { render json: @player.errors, status: :unprocessable_entity }
format.html { render :action => "new" }
format.json { render :json => @player.errors, :status => :unprocessable_entity }
end
end
end
Expand All @@ -60,11 +60,11 @@ def update

respond_to do |format|
if @player.update_attributes(params[:player])
format.html { redirect_to @player, notice: 'Player was successfully updated.' }
format.html { redirect_to @player, :notice => 'Player was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @player.errors, status: :unprocessable_entity }
format.html { render :action => "edit" }
format.json { render :json => @player.errors, :status => :unprocessable_entity }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/players/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<td><%= player.activated %></td>
<td><%= link_to 'Show', player %></td>
<td><%= link_to 'Edit', edit_player_path(player) %></td>
<td><%= link_to 'Destroy', player, confirm: 'Are you sure?', method: :delete %></td>
<td><%= link_to 'Destroy', player, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
Expand Down
10 changes: 5 additions & 5 deletions test/functional/players_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ class PlayersControllerTest < ActionController::TestCase

test "should create player" do
assert_difference('Player.count') do
post :create, player: @player.attributes
post :create, :player => @player.attributes
end

assert_redirected_to player_path(assigns(:player))
end

test "should show player" do
get :show, id: @player
get :show, :id => @player
assert_response :success
end

test "should get edit" do
get :edit, id: @player
get :edit, :id => @player
assert_response :success
end

test "should update player" do
put :update, id: @player, player: @player.attributes
put :update, :id => @player, :player => @player.attributes
assert_redirected_to player_path(assigns(:player))
end

test "should destroy player" do
assert_difference('Player.count', -1) do
delete :destroy, id: @player
delete :destroy, :id => @player
end

assert_redirected_to players_path
Expand Down

0 comments on commit 63c5389

Please sign in to comment.