Sha256: 997ce6e84a59984fd168c9b21b4af0f236d9d64b9d18bda29699867795e09e33

Contents?: true

Size: 1.43 KB

Versions: 7

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'

CLASS = RailsAssist::Artifact::View

class ArtDir
  include CLASS
end

describe RailsAssist::Artifact::View::FileName do
  # use_orm :active_record

  before do
    RailsAssist::Directory.rails_root = File.dirname (__FILE__)
    @test = ArtDir.new
  end

  describe '#view_file_name' do
    it "should return the file name for the persons/show view with default action" do      
      CLASS.view_file_name(:person, :show).should match 'views/person/show'.to_regexp
    end

    it "should return the file name for the persons/show view with template type" do      
      CLASS.view_file_name(:person, :show, :type => :erb).should match 'views/person/show'.to_regexp
    end
    
    it "should return the file name for the persons/show view using hash" do      
      CLASS.view_file_name(:folder => :person, :action => :show, :type => 'erb.hml').should match 'views/person/show'.to_regexp
    end
    
    it "should return the file name for the persons/show view with root path" do      
      CLASS.view_file_name(:folder => :person, :action => :show, :type => :erb, :root_path => RailsAssist::Directory.rails_root).should match 'views/person/show'.to_regexp
    end        

    it "should return the file name for the persons/show view with root path" do      
      CLASS.view_file_name(:folder => :person, :action => :show, :type => :erb, :views_path => 'my/views').should match 'views/person/show'.to_regexp
    end        
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_artifactor-0.5.1 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.5.0 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.4.0 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.3.6 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.3.5 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.3.4 spec/rails_artifactor/artifact/file_name/view_spec.rb
rails_artifactor-0.3.3 spec/rails_artifactor/artifact/file_name/view_spec.rb