Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix spec and use controller_path in mongoid

  • Loading branch information...
commit 23ce2b201e420dcfddf6d3e7466439f32c2c0485 1 parent a6e8ac2
@johnmcaliley johnmcaliley authored
View
4 lib/impressionist/controllers/mongoid/impressionist_controller.rb
@@ -3,8 +3,8 @@
# if :impressionable_id is a valid ObjectId then convert it into one
base = (defined? Moped) ? Moped::BSON : BSON
query_params.reverse_merge!(
- :impressionable_type => controller_name.singularize.camelize,
+ :impressionable_type => controller_path.singularize.camelize,
:impressionable_id=> !base::ObjectId.legal?(params[:id]) ? params[:id] : base::ObjectId.from_string(params[:id])
)
associative_create_statement(query_params)
-end
+end
View
2  test_app/spec/controllers/impressionist_uniqueness_spec.rb
@@ -294,7 +294,7 @@
it "should recognize uniqueness" do
impressionable = Post.create
- controller.stub!(:controller_name).and_return("posts") # for correct impressionable type in filter
+ controller.stub!(:controller_path).and_return("posts") # for correct impressionable type in filter
controller.stub!(:params).and_return({:id => impressionable.id.to_s}) # for correct impressionable id in filter
controller.stub!(:session_hash).and_return("foo")
controller.request.stub!(:remote_ip).and_return("1.2.3.4")
Please sign in to comment.
Something went wrong with that request. Please try again.