Sha256: 91a9cd6618d49fcb637aa7be2b22444e69e313d5ece9ec06a0459a27270f881d

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

describe 'Route prefixes' do

  describe Admin::PrefixController do
    subject {
      controller = Admin::PrefixController.new

      request = ActionController::TestRequest.create
      request.host = "www.example.org"
      controller.request = request
      controller
    }

    let(:model) { Document.new.tap{|document| document.id = 1} }

    it 'respond to edit path helper' do
      subject.edit_resource_path(model).must_match(/^\/admin\//)
    end

    it 'respond to edit url helper' do
      subject.edit_resource_url(model).must_match(/\.org\/admin\//)
    end

    it 'respond to new path helper' do
      subject.new_resource_path.must_match(/^\/admin\//)
    end

    it 'respond to new url helper' do
      subject.new_resource_url.must_match(/\.org\/admin\//)
    end

    it 'respond to collection path helper' do
      subject.collection_path.must_match(/^\/admin/)
    end

    it 'respond to collection url helper' do
      subject.collection_url.must_match(/\.org\/admin/)
    end
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restful_controller-0.2.0 test/prefix_controller_test.rb