Sha256: 2728ce683d36ebce21a9591015744072f2e5f2646e037d11267ecabd6f4263b4
Contents?: true
Size: 1.41 KB
Versions: 7
Compression:
Stored size: 1.41 KB
Contents
require 'test/helper' class Admin::MasterHelperTest < ActiveSupport::TestCase include Admin::MasterHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper def test_display_link_to_previous output = display_link_to_previous(Post, { :action => 'edit', :back_to => '/back_to_param' }) expected = <<-HTML <div id="flash" class="notice"> <p>You're updating a Post. <a href="/back_to_param">Do you want to cancel it?</a></p> </div> HTML assert_equal expected, output end def test_remove_filter_link output = remove_filter_link('') assert output.nil? end def test_build_list_when_returns_a_typus_table model = TypusUser fields = [ 'email', 'role', 'status' ] items = TypusUser.find(:all) resource = 'typus_users' self.stubs(:build_typus_table).returns('a_list_with_items') output = build_list(model, fields, items, resource) expected = 'a_list_with_items' assert_equal expected, output end def test_build_list_when_returns_a_template model = TypusUser fields = [ 'email', 'role', 'status' ] items = TypusUser.find(:all) resource = 'typus_users' self.stubs(:render).returns('a_template') File.stubs(:exists?).returns(true) output = build_list(model, fields, items, resource) expected = 'a_template' assert_equal expected, output end def test_build_pagination assert true end end
Version data entries
7 entries across 7 versions & 1 rubygems