2015-03-16 15:14:33 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe DirectoryItem do
|
|
|
|
context 'refresh' do
|
2015-03-20 13:24:03 -04:00
|
|
|
let!(:post) { Fabricate(:post) }
|
2015-03-16 15:14:33 -04:00
|
|
|
|
|
|
|
it "creates the record for the user" do
|
|
|
|
DirectoryItem.refresh!
|
|
|
|
expect(DirectoryItem.where(period_type: DirectoryItem.period_types[:all])
|
2015-03-20 13:24:03 -04:00
|
|
|
.where(user_id: post.user.id)
|
2015-04-01 12:23:27 -04:00
|
|
|
.exists?).to be_truthy
|
2015-03-16 15:14:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|