Sha256: 8b6072dbda3da69ed29d53982e994cf498edb3f6b1d41de8d3b1d40c0dd4664d

Contents?: true

Size: 842 Bytes

Versions: 12

Compression:

Stored size: 842 Bytes

Contents

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

describe UserCheckoutStat do
  fixtures :user_checkout_stats

  it "calculates user count" do
    old_message_count = Message.count
    user_checkout_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
    UserCheckoutStatQueue.perform(user_checkout_stats(:one).id).should be_truthy
  end
end

# == Schema Information
#
# Table name: user_checkout_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

12 entries across 12 versions & 1 rubygems

Version Path
enju_circulation-0.1.2 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.1 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre49 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre48 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre47 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre46 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre45 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre44 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre43 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre42 spec/models/user_checkout_stat_spec.rb
enju_circulation-0.1.0.pre41 spec/models/user_checkout_stat_spec.rb