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.7.3 test/controllers/extface/devices_controller_test.rb
extface-0.7.2 test/controllers/extface/devices_controller_test.rb
extface-0.7.1 test/controllers/extface/devices_controller_test.rb
extface-0.7.0 test/controllers/extface/devices_controller_test.rb
extface-0.6.9 test/controllers/extface/devices_controller_test.rb
extface-0.6.8 test/controllers/extface/devices_controller_test.rb
extface-0.6.7 test/controllers/extface/devices_controller_test.rb
extface-0.6.6 test/controllers/extface/devices_controller_test.rb
extface-0.6.5 test/controllers/extface/devices_controller_test.rb
extface-0.6.4 test/controllers/extface/devices_controller_test.rb
extface-0.6.3 test/controllers/extface/devices_controller_test.rb
extface-0.6.2 test/controllers/extface/devices_controller_test.rb
extface-0.6.1 test/controllers/extface/devices_controller_test.rb
extface-0.6.0 test/controllers/extface/devices_controller_test.rb
extface-0.5.9 test/controllers/extface/devices_controller_test.rb
extface-0.5.8 test/controllers/extface/devices_controller_test.rb
extface-0.5.7 test/controllers/extface/devices_controller_test.rb
extface-0.5.6 test/controllers/extface/devices_controller_test.rb
extface-0.5.5 test/controllers/extface/devices_controller_test.rb
extface-0.5.4b test/controllers/extface/devices_controller_test.rb