Sha256: ad974542331f37a27ddb7d381105c621807699b0c8c711e1b6165cbac9291ddc

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 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: 'Extface::Driver::RawSerial' }
      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

8 entries across 8 versions & 1 rubygems

Version Path
extface-0.1.0 test/controllers/extface/devices_controller_test.rb
extface-0.0.8 test/controllers/extface/devices_controller_test.rb
extface-0.0.7 test/controllers/extface/devices_controller_test.rb
extface-0.0.6 test/controllers/extface/devices_controller_test.rb
extface-0.0.5 test/controllers/extface/devices_controller_test.rb
extface-0.0.3 test/controllers/extface/devices_controller_test.rb
extface-0.0.2 test/controllers/extface/devices_controller_test.rb
extface-0.0.1 test/controllers/extface/devices_controller_test.rb