mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Add smoke test for reports, fix use of old Distributor model
This commit is contained in:
@@ -53,7 +53,7 @@ Spree::Admin::ReportsController.class_eval do
|
||||
@search = Spree::Order.complete.search(params[:q])
|
||||
orders = @search.result
|
||||
|
||||
@distributors = Distributor.all
|
||||
@distributors = Enterprise.is_distributor
|
||||
|
||||
@report = OpenFoodWeb::GroupBuyReport.new orders
|
||||
unless params[:csv]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require "spec_helper"
|
||||
|
||||
feature %q{
|
||||
As an administration
|
||||
As an administrator
|
||||
I want manage enterprises
|
||||
} do
|
||||
include AuthenticationWorkflow
|
||||
|
||||
27
spec/requests/admin/reports_spec.rb
Normal file
27
spec/requests/admin/reports_spec.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require "spec_helper"
|
||||
|
||||
feature %q{
|
||||
As an administrator
|
||||
I want numbers, all the numbers!
|
||||
} do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
|
||||
|
||||
scenario "orders and distributors report" do
|
||||
login_to_admin_section
|
||||
click_link 'Reports'
|
||||
click_link 'Orders And Distributors'
|
||||
|
||||
page.should have_content 'Order date'
|
||||
end
|
||||
|
||||
scenario "group buys report" do
|
||||
login_to_admin_section
|
||||
click_link 'Reports'
|
||||
click_link 'Group Buys'
|
||||
|
||||
page.should have_content 'Supplier'
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user