Sha256: 58eabb32203c49ccc5c4410b318971fc4e99e9b524eb59afd0c46d4a589fb34e
Contents?: true
Size: 1.57 KB
Versions: 9
Compression:
Stored size: 1.57 KB
Contents
require 'test_helper' module Arcadex class TokensControllerTest < ActionController::TestCase setup do @token = tokens(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:tokens) end test "should get new" do get :new assert_response :success end test "should create token" do assert_difference('Token.count') do post :create, token: { auth_token: @token.auth_token, current_ip_address: @token.current_ip_address, expiration_minutes: @token.expiration_minutes, first_ip_address: @token.first_ip_address, imageable_id: @token.imageable_id, imageable_type: @token.imageable_type, times_used: @token.times_used } end assert_redirected_to token_path(assigns(:token)) end test "should show token" do get :show, id: @token assert_response :success end test "should get edit" do get :edit, id: @token assert_response :success end test "should update token" do patch :update, id: @token, token: { auth_token: @token.auth_token, current_ip_address: @token.current_ip_address, expiration_minutes: @token.expiration_minutes, first_ip_address: @token.first_ip_address, imageable_id: @token.imageable_id, imageable_type: @token.imageable_type, times_used: @token.times_used } assert_redirected_to token_path(assigns(:token)) end test "should destroy token" do assert_difference('Token.count', -1) do delete :destroy, id: @token end assert_redirected_to tokens_path end end end
Version data entries
9 entries across 9 versions & 1 rubygems