Sha256: 4d8566dbaae38703f7398472dce70027403474ab2b3cd590d16719bbdb52711e

Contents?: true

Size: 895 Bytes

Versions: 10

Compression:

Stored size: 895 Bytes

Contents

require 'test_helper'
require 'faker/name'

module Admin
  class ManagersControllerTest < ActionController::TestCase
    setup do
      @manager = create(:manager)
      @manageable = @manager.managable
    end

    test "should get show" do
      get :show, id: @manager, product_id: @manageable
      assert_response :success
    end

    test "should get new" do
      get :new, product_id: @manageable
      assert_response :success
    end

    test "should get edit" do
      get :edit, id: @manager, product_id: @manageable
      assert_response :success
    end

    test "should create" do
      post :create, manager: {firstname: 'Hello'}, product_id: @manageable
      assert_response 302
    end

    test "should update" do
      patch :update, id: @manager, manager: {name: 'Hello'}, product_id: @manageable
      assert_redirected_to admin_product_manager_path
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 test/controllers/admin/managers_controller_test.rb
iord-1.2.1 test/controllers/admin/managers_controller_test.rb
iord-1.2.0 test/controllers/admin/managers_controller_test.rb
iord-1.1.3 test/controllers/admin/managers_controller_test.rb
iord-1.1.2 test/controllers/admin/managers_controller_test.rb
iord-1.1.1 test/controllers/admin/managers_controller_test.rb
iord-1.1.0 test/controllers/admin/managers_controller_test.rb
iord-1.0.3 test/controllers/admin/managers_controller_test.rb
iord-1.0.2 test/controllers/admin/managers_controller_test.rb
iord-1.0.1 test/controllers/admin/managers_controller_test.rb