Sha256: 28419302f9515f67a929fcbbed4cf06a9cb72c69450e9c8b15091900310edd29

Contents?: true

Size: 1.48 KB

Versions: 75

Compression:

Stored size: 1.48 KB

Contents

require 'test_helper'

module Extface
  class DevicesControllerTest < ActionController::TestCase
    setup do
      @device = extface_devices(:one)
    end

    test "should get index" do
      get :index, shop_id: @device.extfaceable, use_route: :extface
      assert_response :success
      assert_not_nil assigns(:devices)
    end

    test "should get new" do
      get :new, shop_id: @device.extfaceable, use_route: :extface
      assert_response :success
    end

    test "should create device" do
      assert_difference('Device.count') do
        post :create, shop_id: @device.extfaceable, use_route: :extface, device: { driver_class: 'Extface::Driver::GenericPos' }
      end

      assert_redirected_to device_path(assigns(:device))
    end

    test "should show device" do
      get :show, shop_id: @device.extfaceable, use_route: :extface, id: @device
      assert_response :success
    end

    test "should get edit" do
      get :edit, shop_id: @device.extfaceable, use_route: :extface, id: @device
      assert_response :success
    end

    test "should update device" do
      patch :update, shop_id: @device.extfaceable, use_route: :extface, id: @device, device: { name: :new_name }
      assert_redirected_to device_path(assigns(:device))
    end

    test "should destroy device" do
      assert_difference('Device.count', -1) do
        delete :destroy, shop_id: @device.extfaceable, use_route: :extface, id: @device
      end

      assert_redirected_to devices_path
    end
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
extface-0.4.5 test/controllers/extface/devices_controller_test.rb
extface-0.4.4b test/controllers/extface/devices_controller_test.rb
extface-0.4.4a test/controllers/extface/devices_controller_test.rb
extface-0.4.4 test/controllers/extface/devices_controller_test.rb
extface-0.4.3g test/controllers/extface/devices_controller_test.rb
extface-0.4.3f test/controllers/extface/devices_controller_test.rb
extface-0.4.3e test/controllers/extface/devices_controller_test.rb
extface-0.4.3d test/controllers/extface/devices_controller_test.rb
extface-0.4.3c test/controllers/extface/devices_controller_test.rb
extface-0.4.3b test/controllers/extface/devices_controller_test.rb
extface-0.4.3a test/controllers/extface/devices_controller_test.rb
extface-0.4.2a test/controllers/extface/devices_controller_test.rb
extface-0.4.2 test/controllers/extface/devices_controller_test.rb
extface-0.4.1b test/controllers/extface/devices_controller_test.rb
extface-0.4.1a test/controllers/extface/devices_controller_test.rb
extface-0.4.0 test/controllers/extface/devices_controller_test.rb
extface-0.3.0c test/controllers/extface/devices_controller_test.rb
extface-0.3.0b test/controllers/extface/devices_controller_test.rb
extface-0.3.0a test/controllers/extface/devices_controller_test.rb
extface-0.3.0 test/controllers/extface/devices_controller_test.rb