Skip to content

Instantly share code, notes, and snippets.

View bleonard's full-sized avatar

Brian Leonard bleonard

View GitHub Profile
describe Content::Post do
fixtures :users
it "should be associated with a user" do
user = fixture(:users, :willy, Content)
post = Content::Post.new(content: "words")
post.user = user
post.save.should == true
user.posts.count.should == 1
end
Failures:
1) Content::Post should be associated with a user
Failure/Error: post.user = user
ActiveRecord::AssociationTypeMismatch:
Content::User(#70346317272500) expected, got Account::User(#70346295701620)
describe Content::Post do
fixtures :users
it "should be associated with a user" do
user = users(:willy)
post = Content::Post.new(content: "words")
post.user = user
post.save.should == true
user.posts.count.should == 1
end
RailsEnginesExample::Application.routes.draw do
mount Admin::Engine => '/', as: 'admin'
mount Account::Engine => '/', as: 'account'
mount Content::Engine => '/', as: 'content'
mount Marketing::Engine => '/', as: 'marketing'
end
RailsEnginesExample::Application.routes.draw do
BootInquirer.each_active_app do |app|
mount app.engine => '/', as: app.gem_name
end
end
= stylesheet_link_tag 'account/manifests/application'
= javascript_include_tag 'account/manifests/application'
initializer 'account.asset_precompile_paths' do |app|
app.config.assets.precompile += ["account/manifests/*"]
end
$ bundle exec rails g migration CreatePosts
invoke active_record
create db/migrate/20140207011608_create_posts.rb
$ mv db/migrate/20140207011608_create_posts.rb apps/content/db/migrate
initializer 'account.append_migrations' do |app|
unless app.root.to_s == root.to_s
config.paths["db/migrate"].expanded.each do |path|
app.config.paths["db/migrate"].push(path)
end
end
end
apps
shared
app
assets
controllers
shared
controller
authentication.rb
models
shared