Sha256: 8d2d9459ffca44ac98bd8bf8a424755f72b0efbfba6622cea8a4e39f42bc531e
Contents?: true
Size: 995 Bytes
Versions: 8
Compression:
Stored size: 995 Bytes
Contents
require 'spec_helper' describe PostsController do it "should log impression at the action level" do get "show", :id=> 1 Impression.all.size.should eq 12 Impression.last.controller_name.should eq "posts" Impression.last.action_name.should eq "show" Impression.last.impressionable_type.should eq "Post" Impression.last.impressionable_id.should eq 1 end it "should log the user_id if user is authenticated (current_user helper method)" do session[:user_id] = 123 get "show", :id=> 1 Post.first.impressions.last.user_id.should eq 123 end it "should log impression at the action level with params" do get "show", id: 1, checked: true Impression.all.size.should eq 12 Impression.last.params.should eq({"checked"=>true}) Impression.last.controller_name.should eq "posts" Impression.last.action_name.should eq "show" Impression.last.impressionable_type.should eq "Post" Impression.last.impressionable_id.should eq 1 end end
Version data entries
8 entries across 8 versions & 2 rubygems