Sha256: ef8b16f35e88b496c7f18c1d0e3480bff231146904057b89c2658d0118d393b2

Contents?: true

Size: 1 KB

Versions: 17

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

class ViewsHelperTest < ActionView::TestCase

  include Errdo::Helpers::ViewsHelper

  context "methods" do
    context "user_show_string" do
      should "default to email" do
        @user = users(:user)
        assert_equal @user.email, user_show_string(@user)
      end

      should "correctly respond to changing the user_string_method" do
        @user = users(:user)
        Errdo.stub :user_string_method, :user_string do
          assert_equal @user.user_string, user_show_string(@user)
        end
      end
    end

    context "user_show_path" do
      should "default to nil when nothing set" do
        @user = users(:user)
        Errdo.stub :user_show_path, nil do
          assert_nil user_show_path(@user)
        end
      end

      should "correctly respond to changing the user_show_page" do
        @user = users(:user)
        Errdo.stub :user_show_path, "user_path" do
          assert_equal user_path(@user.id), user_show_path(@user)
        end
      end
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
errdo-0.12.14 test/helpers/views_helper_test.rb
errdo-0.12.13 test/helpers/views_helper_test.rb
errdo-0.12.12 test/helpers/views_helper_test.rb
errdo-0.12.11 test/helpers/views_helper_test.rb
errdo-0.12.10 test/helpers/views_helper_test.rb
errdo-0.12.9 test/helpers/views_helper_test.rb
errdo-0.12.8 test/helpers/views_helper_test.rb
errdo-0.12.7 test/helpers/views_helper_test.rb
errdo-0.12.6 test/helpers/views_helper_test.rb
errdo-0.12.5 test/helpers/views_helper_test.rb
errdo-0.12.4 test/helpers/views_helper_test.rb
errdo-0.12.3 test/helpers/views_helper_test.rb
errdo-0.12.2 test/helpers/views_helper_test.rb
errdo-0.12.1 test/helpers/views_helper_test.rb
errdo-0.12.0 test/helpers/views_helper_test.rb
errdo-0.11.6 test/helpers/views_helper_test.rb
errdo-0.11.5 test/helpers/views_helper_test.rb