Sha256: add1fb35805ee274e836469afbb5418faec5f1695805035fabf60990300414f5

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

class SmarterListingLoader < ActiveSupport::TestCase

  setup do
    ListingsController.smarter_listing
  end

  test 'smarter listing is loaded' do
    assert_respond_to ActionController::Base, :smarter_listing
  end

  test 'controller extensions are loaded' do
    assert_includes ListingsController.included_modules, SmartListing::Helper::ControllerExtensions
    assert_includes ListingsController.included_modules, SmarterListing::ControllerExtension
  end

  test 'helper methods included' do
    methods = SmartListing::Helper.instance_methods + SmarterListing::Helper.instance_methods
    methods.each do |method|
      assert_includes ListingsController.helpers.methods, method
    end
  end

  test 'the default filter_parameter' do
    assert_includes ListingsController.instance_variables, :@filter_parameter
    assert_equal :filter, ListingsController.instance_variable_get(:@filter_parameter)
  end

  test 'setting a filter_parameter' do
    ListingsController.smarter_listing :qry
    assert_equal :qry, ListingsController.instance_variable_get(:@filter_parameter)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
smarter_listing-0.5.0 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.6.0 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.4.2 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.4.2.pre test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.4.0 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.7 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.6 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.5 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.4 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.3 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.2 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.3.0 test/helpers/smarter_listing_loader_test.rb
smarter_listing-0.2.9 test/helpers/smarter_listing_loader_test.rb