Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
3edad7bf
Commit
3edad7bf
authored
Sep 15, 2017
by
Kaspar Vollenweider
👻
Committed by
Kaspar
Sep 21, 2017
Browse files
adapt tests to one click create and remove obsolete views
parent
1229484f
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/models/billing_expense.rb
View file @
3edad7bf
...
...
@@ -9,7 +9,7 @@ class BillingExpense < ApplicationRecord
default_scope
{
order
(
created_at: :desc
)
}
AMOUNT
=
[
0
,
50
,
100
,
150
].
freeze
AMOUNT
=
[
50
,
100
,
150
].
freeze
validates
:amount
,
inclusion:
{
in:
AMOUNT
}
...
...
app/views/billing_expenses/_form.html.slim
deleted
100644 → 0
View file @
1229484f
=
simple_form_for
[
@volunteer
,
@billing_expense
]
do
|
f
|
=
simple_error_notice
f
=
f
.
hidden_field
:volunteer_id
,
value:
params
[
:volunteer_id
]
.row
.col-xs-12
=
f
.
button
:submit
app/views/billing_expenses/index.html.slim
View file @
3edad7bf
...
...
@@ -32,7 +32,7 @@ h1= t_title(:index, BillingExpense)
.col-xs-12
=
simple_form_for
[
@volunteer
,
BillingExpense
.
new
]
do
|
f
|
=
f
.
hidden_field
:volunteer_id
,
value:
@volunteer
.
id
=
f
.
button
:submit
s
=
f
.
button
:submit
.row
.col-xs-12
=
button_link
t
(
'back'
),
@volunteer
app/views/billing_expenses/new.html.slim
deleted
100644 → 0
View file @
1229484f
.row
.col-xs-12
h1
=
t_title
(
:new
)
=
render
'form'
.row
.col-xs-12
=
button_link
t
(
'back'
),
@volunteer
app/views/volunteers/show.html.slim
View file @
3edad7bf
...
...
@@ -13,7 +13,7 @@ nav.navbar.section-navigation
li
=
simple_form_for
[
@volunteer
,
BillingExpense
.
new
]
do
|
f
|
=
f
.
hidden_field
:volunteer_id
,
value:
@volunteer
.
id
=
f
.
button
:submit
s
=
f
.
button
:submit
-
if
@volunteer
.
billing_expenses
.
any?
li
=
button_link
t_title
(
:index
,
BillingExpense
),
volunteer_billing_expenses_path
(
@volunteer
)
-
if
@volunteer
.
assignments?
...
...
test/system/billing_expenses_test.rb
View file @
3edad7bf
...
...
@@ -8,7 +8,6 @@ class BillingExpensesTest < ApplicationSystemTestCase
create
:hour
,
volunteer:
@volunteer
,
assignment:
assignment
login_as
superadmin
visit
volunteer_path
(
@volunteer
)
click_link
'New Billing expense'
click_button
'Create Billing expense'
end
...
...
@@ -17,10 +16,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
end
test
'no duplicate billing expenses'
do
click_link
'New Billing expense'
click_button
'Create Billing expense'
assert_no_difference
'BillingExpense.count'
do
click_link
'New Billing expense'
click_button
'Create Billing expense'
assert
page
.
has_text?
'This billing expense was already created'
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment