require 'spec_helper'

describe Formol::CategoriesHelper do
  before do
    @user = Factory.build(:user)
    @user.created_at = 15.minutes.ago
    @user.save!
    
    @forum = Factory(:forum)
    @topic = Factory(:topic, :forum => @forum)
  end
  
  describe 'css class' do
    it 'should not have read forum' do
      formol_forum_klass(@forum, @user).split(' ').include?('unread').should be_true
    end
    
    it 'should have read forum' do
      @topic.track_for_user!(@user)
      
      formol_forum_klass(@forum, @user).split(' ').include?('read').should be_true
    end
  end
end
