diff --git a/app/models/post_event.rb b/app/models/post_event.rb index d2159954c..39d7529a8 100644 --- a/app/models/post_event.rb +++ b/app/models/post_event.rb @@ -4,7 +4,7 @@ class PostEvent include ActiveModel::Serializers::Xml attr_accessor :event - delegate :creator_id, :reason, :is_resolved, :created_at, to: :event + delegate :creator, :creator_id, :reason, :is_resolved, :created_at, to: :event def self.find_for_post(post_id) post = Post.find(post_id) diff --git a/test/functional/post_events_controller_test.rb b/test/functional/post_events_controller_test.rb index 3173811a4..0129198b2 100644 --- a/test/functional/post_events_controller_test.rb +++ b/test/functional/post_events_controller_test.rb @@ -25,6 +25,11 @@ class PostEventsControllerTest < ActionController::TestCase get :index, {:post_id => @post.id}, {:user_id => CurrentUser.user.id} assert_response :ok end + + should "render for mods" do + get :index, {:post_id => @post.id}, {:user_id => FactoryGirl.create(:moderator_user).id } + assert_response :success + end end context "GET /posts/:post_id/events.xml" do