1
0
Fork 0
find-us-lunch/test/controllers/friendships_controller_test.rb

50 lines
1.1 KiB
Ruby
Raw Normal View History

2014-10-15 13:32:35 -04:00
require 'test_helper'
class FriendshipsControllerTest < ActionController::TestCase
setup do
@friendship = friendships(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:friendships)
end
test "should get new" do
get :new
assert_response :success
end
test "should create friendship" do
assert_difference('Friendship.count') do
post :create, friendship: { }
end
assert_redirected_to friendship_path(assigns(:friendship))
end
test "should show friendship" do
get :show, id: @friendship
assert_response :success
end
test "should get edit" do
get :edit, id: @friendship
assert_response :success
end
test "should update friendship" do
patch :update, id: @friendship, friendship: { }
assert_redirected_to friendship_path(assigns(:friendship))
end
test "should destroy friendship" do
assert_difference('Friendship.count', -1) do
delete :destroy, id: @friendship
end
assert_redirected_to friendships_path
end
end