Sha256: eb508b73620b38a8d24a0858a74b82b8905da8a013725f137756e0b547ae3791

Contents?: true

Size: 492 Bytes

Versions: 9

Compression:

Stored size: 492 Bytes

Contents

require 'test_helper'

class ImagesControllerTest < ActionController::TestCase
  setup do
    @image = images(:image_one)

    @controller.current_admin = users(:bob)
  end

  test 'get show with correct id parameter' do
    get :show, params: { id: @image.token }, format: :json

    assert_response :success
  end

  test 'get show with incorrect id parameter' do
    assert_raises ActiveRecord::RecordNotFound do
      get :show, params: { id: @image.id }, format: :json
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
simon_says-0.3.0.alpha.7 test/controllers/images_controller_test.rb
simon_says-0.3.0.alpha.6 test/controllers/images_controller_test.rb
simon_says-0.3.0.alpha.5 test/controllers/images_controller_test.rb
simon_says-0.3.0.alpha.4 test/controllers/images_controller_test.rb
simon_says-0.3.0.alpha.3 test/controllers/images_controller_test.rb
simon_says-0.3.0.alpha.1 test/controllers/images_controller_test.rb
simon_says-0.2.0 test/controllers/images_controller_test.rb
simon_says-0.1.6 test/controllers/images_controller_test.rb
simon_says-0.1.5 test/controllers/images_controller_test.rb