mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Remove unnecessary indirection in test
This commit is contained in:
@@ -5,7 +5,7 @@ require 'spec_helper'
|
||||
describe "General Settings" do
|
||||
include AuthenticationHelper
|
||||
|
||||
before(:each) do
|
||||
before do
|
||||
login_as_admin_and_visit spree.admin_dashboard_path
|
||||
click_link "Configuration"
|
||||
click_link "General Settings"
|
||||
@@ -24,16 +24,10 @@ describe "General Settings" do
|
||||
fill_in "site_name", with: "OFN Demo Site99"
|
||||
click_button "Update"
|
||||
|
||||
assert_successful_update_message(:general_settings)
|
||||
|
||||
expect(find("#site_name").value).to eq("OFN Demo Site99")
|
||||
end
|
||||
|
||||
def assert_successful_update_message(resource)
|
||||
flash = Spree.t(:successfully_updated, resource: Spree.t(resource))
|
||||
within("[class='flash success']") do
|
||||
expect(page).to have_content(flash)
|
||||
expect(page).to have_content(Spree.t(:successfully_updated, resource: Spree.t(:general_settings)))
|
||||
end
|
||||
expect(find("#site_name").value).to eq("OFN Demo Site99")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user