1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- require 'test_helper'
- class ContactMessagesControllerTest < ActionController::TestCase
- setup do
- @contact_message = contact_messages(:one)
- end
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:contact_messages)
- end
- test "should get new" do
- get :new
- assert_response :success
- end
- test "should create contact_message" do
- assert_difference('ContactMessage.count') do
- post :create, contact_message: { content: @contact_message.content, email: @contact_message.email, title: @contact_message.title, unread: @contact_message.unread, user_id: @contact_message.user_id }
- end
- assert_redirected_to contact_message_path(assigns(:contact_message))
- end
- test "should show contact_message" do
- get :show, id: @contact_message
- assert_response :success
- end
- test "should get edit" do
- get :edit, id: @contact_message
- assert_response :success
- end
- test "should update contact_message" do
- patch :update, id: @contact_message, contact_message: { content: @contact_message.content, email: @contact_message.email, title: @contact_message.title, unread: @contact_message.unread, user_id: @contact_message.user_id }
- assert_redirected_to contact_message_path(assigns(:contact_message))
- end
- test "should destroy contact_message" do
- assert_difference('ContactMessage.count', -1) do
- delete :destroy, id: @contact_message
- end
- assert_redirected_to contact_messages_path
- end
- end
|