Fixes admin menu link when create a new widget
This commit is contained in:
@@ -9,12 +9,8 @@ module AdminHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def namespaced_root_path
|
def namespaced_root_path
|
||||||
if namespace == 'moderation/budgets'
|
|
||||||
"/moderation"
|
|
||||||
else
|
|
||||||
"/#{namespace}"
|
"/#{namespace}"
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def namespaced_header_title
|
def namespaced_header_title
|
||||||
if namespace == 'moderation/budgets'
|
if namespace == 'moderation/budgets'
|
||||||
@@ -95,7 +91,7 @@ module AdminHelper
|
|||||||
private
|
private
|
||||||
|
|
||||||
def namespace
|
def namespace
|
||||||
controller.class.parent.name.downcase.gsub("::", "/")
|
controller.class.name.downcase.split("::").first
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ module BudgetsHelper
|
|||||||
|
|
||||||
def namespaced_budget_investment_path(investment, options = {})
|
def namespaced_budget_investment_path(investment, options = {})
|
||||||
case namespace
|
case namespace
|
||||||
when "management/budgets"
|
when "management"
|
||||||
management_budget_investment_path(investment.budget, investment, options)
|
management_budget_investment_path(investment.budget, investment, options)
|
||||||
else
|
else
|
||||||
budget_investment_path(investment.budget, investment, options)
|
budget_investment_path(investment.budget, investment, options)
|
||||||
@@ -36,7 +36,7 @@ module BudgetsHelper
|
|||||||
|
|
||||||
def namespaced_budget_investment_vote_path(investment, options = {})
|
def namespaced_budget_investment_vote_path(investment, options = {})
|
||||||
case namespace
|
case namespace
|
||||||
when "management/budgets"
|
when "management"
|
||||||
vote_management_budget_investment_path(investment.budget, investment, options)
|
vote_management_budget_investment_path(investment.budget, investment, options)
|
||||||
else
|
else
|
||||||
vote_budget_investment_path(investment.budget, investment, options)
|
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_recommendations) { Setting.where(key: 'feature.user.recommendations').first }
|
||||||
let(:user) { create(:user) }
|
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
|
end
|
||||||
|
|
||||||
context "Feeds" do
|
context "Feeds" do
|
||||||
|
|||||||
Reference in New Issue
Block a user