Sha256: 784ab5a19fdb3c5e0d7f79c34a83b14d6531761c6f77b76ad382a29990532870

Contents?: true

Size: 852 Bytes

Versions: 18

Compression:

Stored size: 852 Bytes

Contents

require 'test_helper'

class ApplicationHelperTest < ActionView::TestCase

  context "The element_id method" do

    context "when given an object" do

      context "with a new object" do
        setup do
          @obj = Scenario.new
          @id = element_id(@obj)
        end

        should "return a string" do
          assert_equal String, @id.class
        end

        should "return a string containing the class name" do
          # Story_
          assert_match /#{@obj.class.to_s}/, @id
        end

        context "with an existing object" do
          setup do
            @obj = Scenario.make
            @id = element_id(@obj)
          end

          should "return a string containing the class name and id" do
            assert_match /#{@obj.class.to_s}_#{@obj.id}/, @id
          end
        end
      end
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
branston-0.6.6 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.5 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.4 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.3 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.2 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.1 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.6.0 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.5.2 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.5.1 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.5.0 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.6 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.5 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.4 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.3 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.2 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.1 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.4.0 lib/branston/test/unit/helpers/application_helper_test.rb
branston-0.3.6 lib/branston/test/unit/helpers/application_helper_test.rb