Sha256: 933656d78b78781d33724c39ce570772f6619edb2e1d7a976996275eb1149add

Contents?: true

Size: 1.9 KB

Versions: 3

Compression:

Stored size: 1.9 KB

Contents

require 'spec_helper'

CLASS = Rails3::Assist::Artifact::Files

class ArtDir
  extend Rails3::Assist::UseMacro
  use_helper :files  
end

describe Rails3::Assist::Artifact::Files do
  extend Rails3::Assist::UseMacro

  use_helpers :directory

  before do
    Rails3::Assist::Directory.rails_root = fixtures_dir
    @test = ArtDir.new
  end

  describe '#model_files' do 
    it "should return :model files" do    
      @test.model_files.file_names.should include 'user.rb'
    end
  end

  describe '#mailer_files' do 
    it "should return :mailer files" do
      @test.mailer_files.file_names.should include 'user_mailer.rb'
    end
  end

  describe '#observer_files' do 
    it "should return :observer files" do
      @test.observer_files.file_names.should include 'user_observer.rb'
    end
  end

  describe '#permit_files' do 
    it "should return :permit files" do
      @test.permit_files.file_names.should include 'user_permit.rb'
    end
  end

  describe '#license_files' do 
    it "should return :license files" do
      @test.license_files.file_names.should include 'blogging_license.rb'
    end
  end

  describe '#validator_files' do 
    it "should return :validator files" do
      @test.validator_files.file_names.should include 'email_validator.rb'
    end
  end
   
  describe '#helper_files' do 
    it "should return :helper files" do
      @test.helper_files.file_names.should include 'users_helper.rb'
    end
  end
  
  describe '#controller_files' do 
    it "should return :controller files" do
      @test.controller_files.file_names.should include 'users_controller.rb'
    end
  end
  
  describe '#view_files' do 
    it "should return :view files" do
      @test.view_files(:user).file_names.should include 'show.html.erb'
    end
  end 

  describe '#erb_view_files' do 
    it "should return erb :view files" do
      @test.erb_view_files(:user).file_names.should include 'show.html.erb'
    end
  end 
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails3_assist-0.3.7 spec/rails3_assist/artifact/files_spec.rb
rails3_assist-0.3.6 spec/rails3_assist/artifact/files_spec.rb
rails3_assist-0.3.5 spec/rails3_assist/artifact/files_spec.rb