Sha256: fcbbb786dbabbc716b7c4b99917b2cc69d155f635ebe4c4c46f4f7aa7c29571c

Contents?: true

Size: 1.27 KB

Versions: 16

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe Spree::Admin::ReportsController, :type => :controller do
  stub_authorization!

  describe 'ReportsController.available_reports' do
    it 'should contain sales_total' do
      expect(Spree::Admin::ReportsController.available_reports.keys.include?(:sales_total)).to be true
    end

    it 'should have the proper sales total report description' do
      expect(Spree::Admin::ReportsController.available_reports[:sales_total][:description]).to eql('Sales Total For All Orders')
    end

  end

  describe 'ReportsController.add_available_report!' do
    context 'when adding the report name' do
      it 'should contain the report' do
        Spree::Admin::ReportsController.add_available_report!(:some_report)
        expect(Spree::Admin::ReportsController.available_reports.keys.include?(:some_report)).to be true
      end
    end
  end

  describe 'GET index' do
    it 'should be ok' do
      spree_get :index
      expect(response).to be_ok
    end
  end

  it 'should respond to model_class as Spree::AdminReportsController' do
    expect(controller.send(:model_class)).to eql(Spree::Admin::ReportsController)
  end

  after(:each) do
    Spree::Admin::ReportsController.available_reports.delete_if do |key, value|
      key != :sales_total
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-3.1.5 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.4 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.3 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.2 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.10 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.1 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.0 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.0.rc4 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.9 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.0.rc3 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.0.rc2 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.1.0.rc1 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.8 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.7 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.6.1 spec/controllers/spree/admin/reports_controller_spec.rb
spree_backend-3.0.6 spec/controllers/spree/admin/reports_controller_spec.rb