Sha256: 4d2d6fd9242e6a49ff3c7d3f4cc36e7e84276516e45e9efa596356ee298f3183

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

root_dir = Rails3::Assist::Directory.rails_root

describe 'Rails matcher: have_rails_file' do
  use_helpers :file, :controller, :permit
  
  before :each do              
    create_controller :account do
      %q{
        def index
        end
      }
    end    

    create_permit :admin do
      %q{
        license :blogging
      }
    end    

    create_permit :super_admin, :base => :admin do
      %q{
        license :user_admin
      }
    end    

    create_javascript :effects do
      '# effects '
    end    
  end

  after :each do              
    remove_controller :account
    remove_javascript :effects
  end

  it "should not have initializer :hello" do      
    root_dir.should_not have_initializer_file :hello
  end
    
  it "should have a controller :account" do      
    root_dir.should have_controller_file :account
    root_dir.should_not have_controller_file :user
  end

  it "should have a permit for :admin role" do      
    root_dir.should have_permit_file :admin
    root_dir.should have_permit :super_admin
  end

  it "should have a js :effects" do      
    root_dir.should have_javascript_file :effects
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails-app-spec-0.3.2 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.3.1 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.3.0 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.16 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.15 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.14 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.13 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.12 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb
rails-app-spec-0.2.10 spec/rails_app_spec/matchers/file/have_rails_file_spec.rb