Sha256: 15cf30842813b8cc3781c6735c0206df3eab62f6402e1d31146622ce0d9b76f7

Contents?: true

Size: 894 Bytes

Versions: 51

Compression:

Stored size: 894 Bytes

Contents

require 'test_helper'

module Admin
  class WidgetsControllerTest < ActionController::TestCase
    fixtures :all

    def setup
      @toy_category = categories(:toys).to_param
    end

    test "should get show" do
      get :show, category_id: @toy_category, id: widgets(:one).to_param
      assert_response :success
    end

    test "should display the nested index" do
      response = get :index, category_id: @toy_category
      assert_response :success
      assert_match /Lego/, response.body
      refute_match /Hammer/, response.body
    end

    test "nested resources should build from parent resource" do
      post :create, category_id: @toy_category, widget: {column2: 'Cars'}

      response = get :index, category_id: @toy_category
      assert_match /Lego/, response.body
      assert_match /Cars/, response.body
      refute_match /Hammer/, response.body
    end

  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
express_admin-1.7.16 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.16.pre1 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.15 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.14 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.13 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.12 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.11 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.10 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.9 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.8 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.7 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.5 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.4 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.3 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.2 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.7.1 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.6.13 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.6.12 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.6.11 test/dummy/test/controllers/admin/widgets_controller_test.rb
express_admin-1.6.10 test/dummy/test/controllers/admin/widgets_controller_test.rb