Sha256: 123c568f0cf4c085f8db20766c935cd165f2776890fcc283c7cf7fc7eed6dcc9

Contents?: true

Size: 874 Bytes

Versions: 1

Compression:

Stored size: 874 Bytes

Contents

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

describe 'observer' do
  load_helper :observer

  before :each do              
    remove_observer :account        
    create_observer :account do
      %q{
        def index
        end
      }
    end    
  end

  after :each do              
    # remove_observer :account
  end
    
  it "should have an account_observer file that contains an index method and two inserted comments" do
    insert_into_observer :account, :content => '# hello'
    insert_into_observer :account do
      '# goodbye'
    end
    read_observer(:account).should have_comment 'hello'

    Rails.application.should have_observer :account do |observer_file|
      observer_file.should have_method :index
      observer_file.should have_comment 'hello'
      observer_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_observer_spec.rb