Sha256: 7a890510abc3048ad4b871c93339be3c2b7484c3d0e8c5558c46074b6d473d23

Contents?: true

Size: 1.42 KB

Versions: 9

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'

root_dir = Rails3::Assist::Directory.rails_root

describe 'Rails matcher: have_rails_files' do
  use_helpers :files, :file, :controller, :view
  
  before :each do                  
    create_controller :account do
      'blip'
    end    

    create_controller :person do
      'blap'
    end    

    create_javascript :effects do
      '# effects '
    end    
    
    create_javascript :noise do
      '# noise '
    end    

    create_view :person, :edit do
      '# edit person '
    end    
    
    create_view :person, :new do
      '# new person '
    end    
  end

  after :each do              
    # remove_controller :account
  end

  it "should not have a controller :account, :user" do      
    root_dir.should_not have_controller_files :account, :user
  end
    
  it "should have a controller :account, :person" do      
    root_dir.should have_controller_files :account, :person
    root_dir.should_not have_model_files :account, :user
  end

  it "should have a js :effects, :noise" do      
    root_dir.should have_javascript_files :effects, :noise
  end

  it "should not have a js files :effects, :sound" do      
    root_dir.should_not have_javascript_files :effects, :sound
  end
  
  it "should have a view :effects, :noise" do      
    root_dir.should have_view_files :edit, :new, :folder => :person
    root_dir.should_not have_view_files :edit, :unknown, :folder => :person    
  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_files_spec.rb
rails-app-spec-0.3.1 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.3.0 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.16 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.15 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.14 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.13 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.12 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb
rails-app-spec-0.2.10 spec/rails_app_spec/matchers/file/have_rails_files_spec.rb