Sha256: 238ecd1e85f514629630fb280de6baf7d82f83de32d0bc649a7fda82f8d0888f

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe "Routes for institution_management" do
  before(:each) do
    @routes = Bpl::InstitutionManagement::Engine.routes
    # so we have to do this instead:
    # engine routes broke in rspec rails 2.12.1, so we had to add this:
    assertion_instance.instance_variable_set(:@routes, @routes)
  end
  it "should route index" do 
    { :get => '/institutions' }.should route_to( :controller => "institutions", :action => "index")
  end
  it "should create institutions" do 
    { :post => '/institutions' }.should route_to( :controller => "institutions", :action => "create")
  end
  it "should show institutions" do 
    { :get => '/institutions/7' }.should route_to( :controller => "institutions", :action => "show", :id => '7')
  end
  it "should add users" do 
    { :post => '/institutions/7/users' }.should route_to( :controller => "user_institutions", :institution_id=>'7', :action => "create")
  end
  it "should remove users" do 
    { :delete => '/institutions/7/users/5' }.should route_to( :controller => "user_institutions", :institution_id=>'7', :id=>'5', :action => "destroy")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bpl-institution-management-0.0.2 spec/routing/institution_management_routes_spec.rb