Sha256: 19c41cf95285d8e5774d86dd614ad954a39a312f951e7b960a6223ce7f13c585

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 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
    UserReserveStatJob.perform_later(user_reserve_stats(:one)).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
#  updated_at   :datetime
#  started_at   :datetime
#  completed_at :datetime
#  user_id      :integer
#

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_circulation-0.2.0.beta.2 spec/models/user_reserve_stat_spec.rb
enju_circulation-0.2.0.beta.1 spec/models/user_reserve_stat_spec.rb