Sha256: 3d2271e5a2e4f623c0a60ec8578218fdb7574d5e22202194b215258b26222db1

Contents?: true

Size: 745 Bytes

Versions: 10

Compression:

Stored size: 745 Bytes

Contents

require 'spec_helper'

describe RailsBestPractices::Core::Routes do
  let(:routes) { RailsBestPractices::Core::Routes.new }

  it "should add route" do
    routes.add_route(["admin", "test"], "posts", "new")
    routes.map(&:to_s).should == ["Admin::Test::PostsController#new"]
  end

  context "route" do
    it "should add namesapces, controller name and action name" do
      route = RailsBestPractices::Core::Route.new(['admin', 'test'], 'posts', 'new')
      route.to_s.should == "Admin::Test::PostsController#new"
    end

    it "should add controller name with namespace" do
      route = RailsBestPractices::Core::Route.new(['admin'], 'test/posts', 'new')
      route.to_s.should == "Admin::Test::PostsController#new"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_best_practices-1.9.0 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.8.0 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.7.2 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.7.1 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.7.0 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.6.0 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.5.3 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.5.2 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.5.1 spec/rails_best_practices/core/routes_spec.rb
rails_best_practices-1.5.0 spec/rails_best_practices/core/routes_spec.rb