Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
allow moderators to see upcoming episodes in index page
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jul 29, 2011
1 parent f9a00bb commit fbe42df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ability.rb
Expand Up @@ -20,7 +20,7 @@ def initialize(user)
end

if user.moderator?
can :show, :episodes
can :read, :episodes
can :update, :episodes, :notes
can [:update, :destroy, :index], :comments
can :ban, :users
Expand Down
1 change: 1 addition & 0 deletions spec/models/ability_spec.rb
Expand Up @@ -116,6 +116,7 @@
end

it "can view episodes which are not yet published" do
@ability.should be_able_to(:index, Factory.build(:episode, :published_at => 2.days.from_now))
@ability.should be_able_to(:show, Factory.build(:episode, :published_at => 2.days.from_now))
end

Expand Down

0 comments on commit fbe42df

Please sign in to comment.