Sha256: 539453f8cf89debc3b6f454bfb94680f54356071d83d494648c4415367191ff5

Contents?: true

Size: 1.27 KB

Versions: 19

Compression:

Stored size: 1.27 KB

Contents

require 'rails_helper'

describe "rake enju_circulation:export:checkout", type: :rake do
  it "preloads the Rails environment" do
    expect(task.prerequisites).to include "environment"
  end
  it "should export necessary fields" do
    $stdout = StringIO.new
    task.execute
    $stdout.rewind
    str = $stdout.read
    $stdout = STDOUT
    csv = CSV.parse(str, {headers: true, col_sep: "\t"})
    csv.each do |row|
      expect(row).to have_key "checked_out_at"
      expect(row["checked_out_at"]).not_to be_blank
      expect(row).to have_key "due_date"
      expect(row["due_date"]).not_to be_blank
      expect(row).to have_key "item_identifier"
      expect(row["item_identifier"]).not_to be_blank
      expect(row).to have_key "call_number"
      expect(row).to have_key "shelf"
      expect(row["shelf"]).not_to be_blank
      expect(row).to have_key "carrier_type"
      expect(row["carrier_type"]).not_to be_blank
      expect(row).to have_key "title"
      expect(row["title"]).not_to be_blank
      expect(row).to have_key "username"
      expect(row["username"]).not_to be_blank
      expect(row).to have_key "full_name"
      expect(row).to have_key "user_number"
      expect(row["user_number"]).not_to be_blank

      expect(row).not_to have_key "checked_in_at"
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
enju_circulation-0.3.11 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.10 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.9 spec/tasks/export_checkout_spec.rb
enju_circulation-0.4.0.rc.1 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.8 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.7 spec/tasks/export_checkout_spec.rb
enju_circulation-0.4.0.beta.4 spec/tasks/export_checkout_spec.rb
enju_circulation-0.4.0.beta.3 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.6 spec/tasks/export_checkout_spec.rb
enju_circulation-0.4.0.beta.2 spec/tasks/export_checkout_spec.rb
enju_circulation-0.4.0.beta.1 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.5 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.4 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.3 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.2 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.1 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.0 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.0.rc.1 spec/tasks/export_checkout_spec.rb
enju_circulation-0.3.0.beta.1 spec/tasks/export_checkout_spec.rb