Fixes admin menu link when create a new widget
This commit is contained in:
@@ -9,11 +9,7 @@ module AdminHelper
|
||||
end
|
||||
|
||||
def namespaced_root_path
|
||||
if namespace == 'moderation/budgets'
|
||||
"/moderation"
|
||||
else
|
||||
"/#{namespace}"
|
||||
end
|
||||
"/#{namespace}"
|
||||
end
|
||||
|
||||
def namespaced_header_title
|
||||
@@ -95,7 +91,7 @@ module AdminHelper
|
||||
private
|
||||
|
||||
def namespace
|
||||
controller.class.parent.name.downcase.gsub("::", "/")
|
||||
controller.class.name.downcase.split("::").first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -27,7 +27,7 @@ module BudgetsHelper
|
||||
|
||||
def namespaced_budget_investment_path(investment, options = {})
|
||||
case namespace
|
||||
when "management/budgets"
|
||||
when "management"
|
||||
management_budget_investment_path(investment.budget, investment, options)
|
||||
else
|
||||
budget_investment_path(investment.budget, investment, options)
|
||||
@@ -36,7 +36,7 @@ module BudgetsHelper
|
||||
|
||||
def namespaced_budget_investment_vote_path(investment, options = {})
|
||||
case namespace
|
||||
when "management/budgets"
|
||||
when "management"
|
||||
vote_management_budget_investment_path(investment.budget, investment, options)
|
||||
else
|
||||
vote_budget_investment_path(investment.budget, investment, options)
|
||||
|
||||
@@ -19,7 +19,16 @@ feature 'Homepage' do
|
||||
let(:user_recommendations) { Setting.where(key: 'feature.user.recommendations').first }
|
||||
let(:user) { create(:user) }
|
||||
|
||||
scenario "Header" do
|
||||
context "Header" do
|
||||
|
||||
scenario "Admin menu links to homepage path" do
|
||||
|
||||
visit new_admin_widget_card_path(header_card: true)
|
||||
|
||||
click_link Setting['org_name'] + " Administration"
|
||||
|
||||
expect(page).to have_current_path(admin_root_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "Feeds" do
|
||||
@@ -128,4 +137,4 @@ feature 'Homepage' do
|
||||
expect(page).to have_content("Recommendations that may interest you")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user