Sha256: 0e5b767033e817a64968831cd42dfef6d5ed9a88eb1a29e2b31fc84a11dd529f

Contents?: true

Size: 870 Bytes

Versions: 4

Compression:

Stored size: 870 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'

describe UserReserveStat do
  fixtures :user_reserve_stats

  it "calculates user count" do
    old_message_count = Message.count
    user_reserve_stats(:one).transition_to!(:started).should be_truthy
    Message.count.should eq old_message_count + 1
    Message.order(:id).last.subject.should eq '集計が完了しました'
  end

  it "should calculate in background" do
    UserReserveStatQueue.perform(user_reserve_stats(:one).id).should be_truthy
  end
end

# == Schema Information
#
# Table name: user_reserve_stats
#
#  id           :integer          not null, primary key
#  start_date   :datetime
#  end_date     :datetime
#  note         :text
#  created_at   :datetime         not null
#  updated_at   :datetime         not null
#  started_at   :datetime
#  completed_at :datetime
#  user_id      :integer
#

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre40 spec/models/user_reserve_stat_spec.rb
enju_circulation-0.1.0.pre39 spec/models/user_reserve_stat_spec.rb
enju_circulation-0.1.0.pre38 spec/models/user_reserve_stat_spec.rb
enju_circulation-0.1.0.pre37 spec/models/user_reserve_stat_spec.rb