Sha256: af913640056b7423d3fb12581042c76aa4b2cc2286035f21be14ae034ac1f464

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe 'view' do
  load_helper :view

  before :each do              
    remove_view :account        
    create_view :account do
      %q{  def index
  end}
    end    
  end

  after :each do              
    # remove_view :account
  end
    
  it "should have an account_view file that contains an index method and two inserted comments" do
    insert_into_view :account, :content => '# hello', :before => 'def'
    insert_into_view :account, :before => 'def' do
      '# goodbye'
    end
    read_view(:account).should have_comment 'hello'

    Rails.application.should have_view :account do |view_file|
      view_file.should have_method :index
      view_file.should have_comment 'hello'
      view_file.should have_comment 'goodbye'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generator-spec-0.5.0 spec/generator_spec/rails_helpers/rails_view_spec.rb