Skip to content

Commit

Permalink
Repair specs
Browse files Browse the repository at this point in the history
  • Loading branch information
pacodelaluna committed Nov 28, 2024
1 parent 9487d14 commit 193be72
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/views/admin/enterprises/_new_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :sells, t('primary_details.sells', scope: scope)
%div{'ofn-with-tip' => t('primary_details.sells_tip', scope: scope)}
= f.label :sells, t('admin_only.sells', scope: scope)
%div{'ofn-with-tip' => t('admin_only.sells_tip', scope: scope)}
%a What's this?
.two.columns
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'
 
= f.label :sells, t('primary_details.none', scope: scope), value: "none"
= f.label :sells, t('admin_only.none', scope: scope), value: "none"
.two.columns
= f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells'
 
= f.label :sells, t('primary_details.own', scope: scope), value: "own"
= f.label :sells, t('admin_only.own', scope: scope), value: "own"
.four.columns.omega
= f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells'
 
= f.label :sells, t('primary_details.any', scope: scope), value: "any"
= f.label :sells, t('admin_only.any', scope: scope), value: "any"

.row
.alpha.three.columns
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,7 @@ en:
enterprise:
primary_details: "Primary Details"
address: "Address"
admin_only: "Admin Only"
contact: "Contact"
social: "Social"
about: "About"
Expand Down
9 changes: 4 additions & 5 deletions spec/controllers/api/v0/enterprises_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:enterprise) { create(:distributor_enterprise) }

context "as an admin user" do
let(:admin) { create(:user) }
let(:admin) { create(:admin_user) }
let!(:enterprise) { create(:distributor_enterprise) }

before do
Expand All @@ -18,13 +18,12 @@
describe "updating an enterprise" do
let(:enterprise_params) do
{
enterprise_id: enterprise.id,
enterprise: { external_billing_id: 'INV123456' }
external_billing_id: 'INV123456'
}
end

it "creates a visible=hidden enterprise" do
api_post :create, enterprise_params
it "changes the external_billing_id field" do
api_put :update, id: enterprise.id, enterprise: enterprise_params
expect(response.status).to eq 200

expect(enterprise.reload.external_billing_id).to eq('INV123456')
Expand Down
4 changes: 4 additions & 0 deletions spec/system/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
end

fill_in 'enterprise_name', with: 'Eaterprises'

accept_alert do
click_link "Admin Only"
end
fill_in 'enterprise_permalink', with: 'eaterprises-permalink'
expect(page).to have_selector '.available'
choose 'Own'
Expand Down
4 changes: 4 additions & 0 deletions spec/system/admin/reports/revenues_by_hub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"Hub",
"Hub ID",
"Hub Business Number",
"Hub External Billing Id",
"Hub Legal Name",
"Hub Contact Name",
"Hub Public Email",
Expand All @@ -89,6 +90,7 @@
"none",
"none",
"none",
"none",
"[email protected]",
"none",
"10 Lovely Street",
Expand All @@ -110,6 +112,7 @@
"none",
"none",
"none",
"none",
"[email protected]",
"none",
"10 Lovely Street",
Expand All @@ -131,6 +134,7 @@
"none",
"none",
"none",
"none",
"[email protected]",
"none",
"10 Lovely Street",
Expand Down

0 comments on commit 193be72

Please sign in to comment.