mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Pre-fill rule suggestion with transaction name and category (#497)
Co-authored-by: Carlos Adames <cj@Carloss-MacBook-Air.local>
This commit is contained in:
@@ -10,6 +10,23 @@ class RulesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new with pre-filled name and action" do
|
||||
category = categories(:food_and_drink)
|
||||
get new_rule_url(
|
||||
resource_type: "transaction",
|
||||
name: "Starbucks",
|
||||
action_type: "set_transaction_category",
|
||||
action_value: category.id
|
||||
)
|
||||
assert_response :success
|
||||
|
||||
assert_select "input[name='rule[name]'][value='Starbucks']"
|
||||
assert_select "input[name*='[value]'][value='Starbucks']"
|
||||
assert_select "select[name*='[condition_type]'] option[selected][value='transaction_name']"
|
||||
assert_select "select[name*='[action_type]'] option[selected][value='set_transaction_category']"
|
||||
assert_select "select[name*='[value]'] option[selected][value='#{category.id}']"
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_rule_url(rules(:one))
|
||||
assert_response :success
|
||||
|
||||
Reference in New Issue
Block a user