Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gem 'rails', '>0.a'
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

# gem 'solidus_reports', github: 'solidusio-contrib/solidus_reports'
gem 'solidus_reports', github: 'solidusio-contrib/solidus_reports'

case ENV['DB']
when 'mysql'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def marketplace_reports

def get_supplier_earnings
grouped_supplier_earnings.each do |se|
se[:earnings] = se[:earnings].inject(Spree::Money.new(0)) do |e, c|
se[:earnings] = se[:earnings].inject(::Spree::Money.new(0)) do |e, c|
c + e
end
end
Expand All @@ -57,7 +57,7 @@ def get_supplier_earnings
def grouped_supplier_earnings
params[:q] = search_params

@search = Spree::Order.complete.not_canceled.ransack(params[:q])
@search = ::Spree::Order.complete.not_canceled.ransack(params[:q])
@orders = @search.result

supplier_earnings_map = @orders.map(&:supplier_earnings_map)
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
resources :reports, only: [:index] do
collection do
get :earnings
post :earnings
end
end

Expand Down
12 changes: 12 additions & 0 deletions spec/features/spree/admin/reports_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

describe 'Reports', type: :feature, js: true do
stub_authorization!

describe 'Earnings' do
it 'renders correctly' do
visit spree.earnings_admin_reports_path
expect(page).to have_content(I18n.t('spree.earnings'))
end
end
end