discourse/spec/models/category_featured_user_spec.rb

26 lines
513 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
require 'spec_helper'
describe CategoryFeaturedUser do
2013-02-25 11:42:20 -05:00
it { is_expected.to belong_to :category }
it { is_expected.to belong_to :user }
2013-02-05 14:16:51 -05:00
context 'featuring users' do
before do
@category = Fabricate(:category)
CategoryFeaturedUser.feature_users_in(@category)
end
it 'has a featured user' do
expect(CategoryFeaturedUser.count).to be(1)
2013-02-05 14:16:51 -05:00
end
it 'returns the user via the category association' do
expect(@category.featured_users).to be_present
2013-02-05 14:16:51 -05:00
end
end
end