Sha256: a4ce74c7fcf0d8258fcd131e1e40d4416f43a19bcf0775ebf91f86b49d95d539
Contents?: true
Size: 1.92 KB
Versions: 3
Compression:
Stored size: 1.92 KB
Contents
require File.join(File.dirname(__FILE__), '/../../test_helper') class RouteBuilder include Cms::Routes end class Bear < ActiveRecord::Base acts_as_content_block end class Kindness < ActiveRecord::Base acts_as_content_block end class RoutesTest < ActiveSupport::TestCase test "Verify behavior of classify, and how it works with already pluralized symbols" do assert_equal "Kindness", :kindnesses.to_s.classify, "routes will pass 'plural' symbols to 'content_block', rather than single" end test "behavior of 'content_blocks' route generator" do rb = RouteBuilder.new # Expect rb.expects(:resources).with(:bears, {:member => {:publish => :put, :usages => :get, :versions => :get}}) rb.expects(:version_cms_bears).with("/cms/bears/:id/version/:version", :controller => "cms/bears", :action => "version", :conditions => {:method => :get}) rb.expects(:revert_to_cms_bears).with( "/cms/bears/:id/revert_to/:version", :controller => "cms/bears", :action => "revert_to", :conditions => {:method => :put}) rb.content_blocks :bears # Verifies the exact messages being passed to the route generator end test "behavior of 'content_blocks' route generator with model names with s at the end" do rb = RouteBuilder.new # Expect rb.expects(:resources).with(:kindnesses, {:member => {:publish => :put, :usages => :get, :versions => :get}}) rb.expects(:version_cms_kindnesses).with("/cms/kindnesses/:id/version/:version", :controller => "cms/kindnesses", :action => "version", :conditions => {:method => :get}) rb.expects(:revert_to_cms_kindnesses).with( "/cms/kindnesses/:id/revert_to/:version", :controller => "cms/kindnesses", :action => "revert_to", :conditions => {:method => :put}) rb.content_blocks :kindnesses # Verifies the exact messages being passed to the route generator end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
webficient-browsercms-3.0.2 | test/unit/lib/routes_test.rb |
webficient-browsercms-3.0.3 | test/unit/lib/routes_test.rb |
webficient-browsercms-3.0.4 | test/unit/lib/routes_test.rb |