Routes have been refactored
Dashboard routes have been refactored. Now instead of having resources for dashboard and routes inside a dashboard namespace the proposal routes contain a dashboar singleton containing everything related to it.
This commit is contained in:
42
app/controllers/dashboard/actions_controller.rb
Normal file
42
app/controllers/dashboard/actions_controller.rb
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
class Dashboard::ActionsController < Dashboard::BaseController
|
||||||
|
helper_method :dashboard_action
|
||||||
|
|
||||||
|
def new_request
|
||||||
|
authorize! :dashboard, proposal
|
||||||
|
@dashboard_executed_action = Dashboard::ExecutedAction.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_request
|
||||||
|
authorize! :dashboard, proposal
|
||||||
|
|
||||||
|
source_params = {
|
||||||
|
proposal: proposal,
|
||||||
|
action: dashboard_action,
|
||||||
|
executed_at: Time.now
|
||||||
|
}
|
||||||
|
|
||||||
|
@dashboard_executed_action = Dashboard::ExecutedAction.new(source_params)
|
||||||
|
if @dashboard_executed_action.save
|
||||||
|
Dashboard::AdministratorTask.create(source: @dashboard_executed_action)
|
||||||
|
|
||||||
|
redirect_to progress_proposal_dashboard_path(proposal.to_param), { flash: { info: t('dashboard.create_request.success') } }
|
||||||
|
else
|
||||||
|
flash.now[:alert] = @dashboard_executed_action.errors.full_messages.join('<br>')
|
||||||
|
render :new_request
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def execute
|
||||||
|
authorize! :dashboard, proposal
|
||||||
|
|
||||||
|
Dashboard::ExecutedAction.create(proposal: proposal, action: dashboard_action, executed_at: Time.now)
|
||||||
|
redirect_to progress_proposal_dashboard_path(proposal.to_param)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def dashboard_action
|
||||||
|
@dashboard_action ||= Dashboard::Action.find(params[:id])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class DashboardController < Dashboard::BaseController
|
class DashboardController < Dashboard::BaseController
|
||||||
helper_method :dashboard_action, :active_resources, :course
|
helper_method :dashboard_action, :active_resources, :course
|
||||||
|
|
||||||
def index
|
def show
|
||||||
authorize! :dashboard, proposal
|
authorize! :dashboard, proposal
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -9,39 +9,7 @@ class DashboardController < Dashboard::BaseController
|
|||||||
authorize! :publish, proposal
|
authorize! :publish, proposal
|
||||||
|
|
||||||
proposal.publish
|
proposal.publish
|
||||||
redirect_to proposal_dashboard_index_path(proposal), notice: t('proposals.notice.published')
|
redirect_to proposal_dashboard_path(proposal), notice: t('proposals.notice.published')
|
||||||
end
|
|
||||||
|
|
||||||
def execute
|
|
||||||
authorize! :dashboard, proposal
|
|
||||||
|
|
||||||
Dashboard::ExecutedAction.create(proposal: proposal, action: dashboard_action, executed_at: Time.now)
|
|
||||||
redirect_to progress_proposal_dashboard_index_path(proposal.to_param)
|
|
||||||
end
|
|
||||||
|
|
||||||
def new_request
|
|
||||||
authorize! :dashboard, proposal
|
|
||||||
@dashboard_executed_action = Dashboard::ExecutedAction.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_request
|
|
||||||
authorize! :dashboard, proposal
|
|
||||||
|
|
||||||
source_params = {
|
|
||||||
proposal: proposal,
|
|
||||||
action: dashboard_action,
|
|
||||||
executed_at: Time.now
|
|
||||||
}
|
|
||||||
|
|
||||||
@dashboard_executed_action = Dashboard::ExecutedAction.new(source_params)
|
|
||||||
if @dashboard_executed_action.save
|
|
||||||
Dashboard::AdministratorTask.create(source: @dashboard_executed_action)
|
|
||||||
|
|
||||||
redirect_to progress_proposal_dashboard_index_path(proposal.to_param), { flash: { info: t('dashboard.create_request.success') } }
|
|
||||||
else
|
|
||||||
flash.now[:alert] = @dashboard_executed_action.errors.full_messages.join('<br>')
|
|
||||||
render :new_request
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def progress
|
def progress
|
||||||
@@ -54,10 +22,6 @@ class DashboardController < Dashboard::BaseController
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def dashboard_action
|
|
||||||
@dashboard_action ||= Dashboard::Action.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def active_resources
|
def active_resources
|
||||||
@active_resources ||= Dashboard::Action.active.resources.order(required_supports: :asc, day_offset: :asc)
|
@active_resources ||= Dashboard::Action.active.resources.order(required_supports: :asc, day_offset: :asc)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% if dashboard_action.request_to_administrators && !dashboard_action.requested_for?(proposal) %>
|
<% if dashboard_action.request_to_administrators && !dashboard_action.requested_for?(proposal) %>
|
||||||
<%= form_for @dashboard_executed_action,
|
<%= form_for @dashboard_executed_action,
|
||||||
url: create_request_proposal_dashboard_url(proposal, dashboard_action) do |f| %>
|
url: create_request_proposal_dashboard_action_url(proposal, dashboard_action) do |f| %>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit(class: 'button', value: t("dashboard.form.request")) %>
|
<%= f.submit(class: 'button', value: t("dashboard.form.request")) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<ul id="proposal_dashboard_menu" data-multi-open="false">
|
<ul id="proposal_dashboard_menu" data-multi-open="false">
|
||||||
<li class="section-title">
|
<li class="section-title">
|
||||||
<%= link_to proposal_dashboard_index_path(proposal.to_param), class: my_proposal_menu_class do %>
|
<%= link_to proposal_dashboard_path(proposal.to_param), class: my_proposal_menu_class do %>
|
||||||
<i class="fi-lightbulb"></i>
|
<i class="fi-lightbulb"></i>
|
||||||
<strong><%= t("dashboard.menu.my_proposal") %></strong>
|
<strong><%= t("dashboard.menu.my_proposal") %></strong>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="section-title">
|
<li class="section-title">
|
||||||
<%= link_to progress_proposal_dashboard_index_path(proposal.to_param),
|
<%= link_to progress_proposal_dashboard_path(proposal.to_param),
|
||||||
class: progress_menu_class do %>
|
class: progress_menu_class do %>
|
||||||
<span class="fi-graph-trend"></span>
|
<span class="fi-graph-trend"></span>
|
||||||
<strong><%= t("dashboard.menu.progress") %></strong>
|
<strong><%= t("dashboard.menu.progress") %></strong>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
<% resources.each do |resource| %>
|
<% resources.each do |resource| %>
|
||||||
<li <%= 'class=is-active' if is_request_active(resource.id) %>>
|
<li <%= 'class=is-active' if is_request_active(resource.id) %>>
|
||||||
<%= link_to new_request_proposal_dashboard_path(proposal, resource) do %>
|
<%= link_to new_request_proposal_dashboard_action_path(proposal, resource) do %>
|
||||||
<span data-tooltip title="<%= resource.short_description %>">
|
<span data-tooltip title="<%= resource.short_description %>">
|
||||||
<%= resource.title %>
|
<%= resource.title %>
|
||||||
</span>
|
</span>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<li class="section-title">
|
<li class="section-title">
|
||||||
<%= link_to community_proposal_dashboard_index_path(proposal.to_param),
|
<%= link_to community_proposal_dashboard_path(proposal.to_param),
|
||||||
class: community_menu_class do %>
|
class: community_menu_class do %>
|
||||||
<span class="fi-torsos-all"></span>
|
<span class="fi-torsos-all"></span>
|
||||||
<strong><%= t("dashboard.menu.community") %></strong>
|
<strong><%= t("dashboard.menu.community") %></strong>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<% if proposed_action.proposals.where(id: proposal.id).any? %>
|
<% if proposed_action.proposals.where(id: proposal.id).any? %>
|
||||||
<i class="fi-check success"></i>
|
<i class="fi-check success"></i>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to execute_proposal_dashboard_path(proposal, proposed_action), method: :post, id: "#{dom_id(proposed_action)}_execute" do %>
|
<%= link_to execute_proposal_dashboard_action_path(proposal, proposed_action), method: :post, id: "#{dom_id(proposed_action)}_execute" do %>
|
||||||
<div class="checkbox-unchecked">
|
<div class="checkbox-unchecked">
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<% if resource.executed_for?(proposal) %>
|
<% if resource.executed_for?(proposal) %>
|
||||||
<div class="bottom-element text-center">
|
<div class="bottom-element text-center">
|
||||||
<%= link_to t("dashboard.resource.view_resource"),
|
<%= link_to t("dashboard.resource.view_resource"),
|
||||||
new_request_proposal_dashboard_path(proposal, resource),
|
new_request_proposal_dashboard_action_path(proposal, resource),
|
||||||
class: 'button success' %>
|
class: 'button success' %>
|
||||||
</div>
|
</div>
|
||||||
<% elsif resource.requested_for?(proposal) %>
|
<% elsif resource.requested_for?(proposal) %>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<% elsif resource.active_for?(proposal) %>
|
<% elsif resource.active_for?(proposal) %>
|
||||||
<div class="bottom-element text-center">
|
<div class="bottom-element text-center">
|
||||||
<%= link_to t("dashboard.resource.request_resource"),
|
<%= link_to t("dashboard.resource.request_resource"),
|
||||||
new_request_proposal_dashboard_path(proposal, resource),
|
new_request_proposal_dashboard_action_path(proposal, resource),
|
||||||
class: 'button primary' %>
|
class: 'button primary' %>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<%= link_to t("dashboard.progress.group_by_date"),
|
<%= link_to t("dashboard.progress.group_by_date"),
|
||||||
progress_proposal_dashboard_index_path(proposal),
|
progress_proposal_dashboard_path(proposal),
|
||||||
class: "button #{daily_selected_class}" %>
|
class: "button #{daily_selected_class}" %>
|
||||||
<%= link_to t("dashboard.progress.group_by_week"),
|
<%= link_to t("dashboard.progress.group_by_week"),
|
||||||
progress_proposal_dashboard_index_path(proposal, group_by: 'week'),
|
progress_proposal_dashboard_path(proposal, group_by: 'week'),
|
||||||
class: "button #{weekly_selected_class}" %>
|
class: "button #{weekly_selected_class}" %>
|
||||||
<%= link_to t("dashboard.progress.group_by_month"),
|
<%= link_to t("dashboard.progress.group_by_month"),
|
||||||
progress_proposal_dashboard_index_path(proposal, group_by: 'month'),
|
progress_proposal_dashboard_path(proposal, group_by: 'month'),
|
||||||
class: "button #{monthly_selected_class}" %>
|
class: "button #{monthly_selected_class}" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if can?(:publish, proposal) %>
|
<% if can?(:publish, proposal) %>
|
||||||
<%= link_to t("dashboard.index.publish"), publish_proposal_dashboard_index_path(proposal), class: 'button success', method: :patch %>
|
<%= link_to t("dashboard.index.publish"), publish_proposal_dashboard_path(proposal), class: 'button success', method: :patch %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
|
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
|
||||||
<div class="show-for-small-only">
|
<div class="show-for-small-only">
|
||||||
<div class="dashboard-sidebar" data-equalizer-watch>
|
<div class="dashboard-sidebar" data-equalizer-watch>
|
||||||
<%= render partial: 'dashboard/menu' %>
|
<%= render partial: "dashboard/menu" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,14 +50,14 @@
|
|||||||
|
|
||||||
<div id="side_menu" class="hide-for-small-only">
|
<div id="side_menu" class="hide-for-small-only">
|
||||||
<div class="dashboard-sidebar" data-equalizer-watch>
|
<div class="dashboard-sidebar" data-equalizer-watch>
|
||||||
<%= render partial: 'dashboard/menu' %>
|
<%= render partial: "dashboard/menu" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="admin-content small-12 medium-9 column" data-equalizer-watch>
|
<div class="admin-content small-12 medium-9 column" data-equalizer-watch>
|
||||||
<%= render partial: 'layouts/flash' %>
|
<%= render partial: "layouts/flash" %>
|
||||||
<%= render partial: 'layouts/dashboard/proposal_totals' %>
|
<%= render partial: "layouts/dashboard/proposal_totals" %>
|
||||||
<%= render partial: 'layouts/dashboard/proposal_header' %>
|
<%= render partial: "layouts/dashboard/proposal_header" %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<%= raw t("proposals.created.motivation_html") %>
|
<%= raw t("proposals.created.motivation_html") %>
|
||||||
|
|
||||||
<%= link_to t("proposals.created.dashboard"), proposal_dashboard_index_path(@proposal), class: "button" if can?(:dashboard, @proposal) %>
|
<%= link_to t("proposals.created.dashboard"), proposal_dashboard_path(@proposal), class: "button" if can?(:dashboard, @proposal) %>
|
||||||
<%= link_to t("proposals.created.publish"), publish_proposal_path(@proposal), method: :patch, class: "button" if can?(:publish, @proposal) %>
|
<%= link_to t("proposals.created.publish"), publish_proposal_path(@proposal), method: :patch, class: "button" if can?(:publish, @proposal) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<strong><%= t('.improve_it') %></strong>
|
<strong><%= t('.improve_it') %></strong>
|
||||||
</p>
|
</p>
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
<%= link_to t('.dashboard'), proposal_dashboard_index_path(@proposal), class: 'button' %>
|
<%= link_to t('.dashboard'), proposal_dashboard_path(@proposal), class: 'button' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
<div class="sidebar-divider"></div>
|
<div class="sidebar-divider"></div>
|
||||||
<h2><%= t("proposals.show.author") %></h2>
|
<h2><%= t("proposals.show.author") %></h2>
|
||||||
<div class="show-actions-menu">
|
<div class="show-actions-menu">
|
||||||
<%= link_to proposal_dashboard_index_path(@proposal), class: 'button hollow expanded', id: "proposal-dashboard-#{@proposal.id}" do %>
|
<%= link_to proposal_dashboard_path(@proposal), class: 'button hollow expanded', id: "proposal-dashboard-#{@proposal.id}" do %>
|
||||||
<span class="icon-edit"></span>
|
<span class="icon-edit"></span>
|
||||||
<%= t("proposals.show.dashboard_proposal_link") %>
|
<%= t("proposals.show.dashboard_proposal_link") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<% elsif can?(:dashboard, proposal) %>
|
<% elsif can?(:dashboard, proposal) %>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to t("proposals.show.dashboard_proposal_link"),
|
<%= link_to t("proposals.show.dashboard_proposal_link"),
|
||||||
proposal_dashboard_index_path(proposal), class: 'button hollow expanded' %>
|
proposal_dashboard_path(proposal), class: 'button hollow expanded' %>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
|||||||
@@ -1,28 +1,27 @@
|
|||||||
resources :proposals do
|
resources :proposals do
|
||||||
resources :dashboard, only: [:index] do
|
resource :dashboard, only: [:show], controller: 'dashboard' do
|
||||||
collection do
|
collection do
|
||||||
patch :publish
|
patch :publish
|
||||||
get :progress
|
get :progress
|
||||||
get :community
|
get :community
|
||||||
end
|
end
|
||||||
|
|
||||||
member do
|
resources :resources, only: [:index], controller: 'dashboard/resources'
|
||||||
post :execute
|
resources :achievements, only: [:index], controller: 'dashboard/achievements'
|
||||||
get :new_request
|
resources :successful_supports, only: [:index], controller: 'dashboard/successful_supports'
|
||||||
post :create_request
|
resources :supports, only: [:index], controller: 'dashboard/supports'
|
||||||
|
resources :polls, except: [:show, :destroy], controller: 'dashboard/polls'
|
||||||
|
resources :mailing, only: [:index, :new, :create], controller: 'dashboard/mailing'
|
||||||
|
resources :poster, only: [:index, :new], controller: 'dashboard/poster'
|
||||||
|
resources :actions, only: [], controller: 'dashboard/actions' do
|
||||||
|
member do
|
||||||
|
post :execute
|
||||||
|
get :new_request
|
||||||
|
post :create_request
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :dashboard do
|
|
||||||
resources :resources, only: [:index]
|
|
||||||
resources :achievements, only: [:index]
|
|
||||||
resources :successful_supports, only: [:index]
|
|
||||||
resources :supports, only: [:index]
|
|
||||||
resources :polls, except: [:show, :destroy]
|
|
||||||
resources :mailing, only: [:index, :new, :create]
|
|
||||||
resources :poster, only: [:index, :new]
|
|
||||||
end
|
|
||||||
|
|
||||||
member do
|
member do
|
||||||
post :vote
|
post :vote
|
||||||
post :vote_featured
|
post :vote_featured
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ feature "Proposal's dashboard" do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
login_as(proposal.author)
|
login_as(proposal.author)
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Dashboard has a link to my proposal' do
|
scenario 'Dashboard has a link to my proposal' do
|
||||||
@@ -33,7 +33,7 @@ feature "Proposal's dashboard" do
|
|||||||
goal = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 1_000)
|
goal = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 1_000)
|
||||||
future_goal = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 2_000)
|
future_goal = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 2_000)
|
||||||
|
|
||||||
visit progress_proposal_dashboard_index_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
|
|
||||||
within 'div#goals-section' do
|
within 'div#goals-section' do
|
||||||
expect(page).to have_content(goal.title)
|
expect(page).to have_content(goal.title)
|
||||||
@@ -49,7 +49,7 @@ feature "Proposal's dashboard" do
|
|||||||
scenario 'Dashboard progress show proposed actions' do
|
scenario 'Dashboard progress show proposed actions' do
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
action = create(:dashboard_action, :proposed_action, :active)
|
||||||
|
|
||||||
visit progress_proposal_dashboard_index_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
expect(page).to have_content(action.title)
|
expect(page).to have_content(action.title)
|
||||||
|
|
||||||
find(:css, "#dashboard_action_#{action.id}_execute").click
|
find(:css, "#dashboard_action_#{action.id}_execute").click
|
||||||
@@ -69,7 +69,7 @@ feature "Proposal's dashboard" do
|
|||||||
|
|
||||||
unavailable = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 1_000)
|
unavailable = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 1_000)
|
||||||
|
|
||||||
visit progress_proposal_dashboard_index_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
within 'div#available-resources-section' do
|
within 'div#available-resources-section' do
|
||||||
expect(page).to have_content('Polls')
|
expect(page).to have_content('Polls')
|
||||||
expect(page).to have_content('E-mail')
|
expect(page).to have_content('E-mail')
|
||||||
@@ -112,14 +112,14 @@ feature "Proposal's dashboard" do
|
|||||||
scenario 'Dashboard has a link to resources on main menu' do
|
scenario 'Dashboard has a link to resources on main menu' do
|
||||||
feature = create(:dashboard_action, :resource, :active)
|
feature = create(:dashboard_action, :resource, :active)
|
||||||
|
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
expect(page).to have_link(feature.title)
|
expect(page).to have_link(feature.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Request resource with admin request', js: true do
|
scenario 'Request resource with admin request', js: true do
|
||||||
feature = create(:dashboard_action, :resource, :active, :admin_request)
|
feature = create(:dashboard_action, :resource, :active, :admin_request)
|
||||||
|
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
click_link(feature.title)
|
click_link(feature.title)
|
||||||
|
|
||||||
click_button 'Request'
|
click_button 'Request'
|
||||||
@@ -129,7 +129,7 @@ feature "Proposal's dashboard" do
|
|||||||
scenario 'Request already requested resource with admin request', js: true do
|
scenario 'Request already requested resource with admin request', js: true do
|
||||||
feature = create(:dashboard_action, :resource, :active, :admin_request)
|
feature = create(:dashboard_action, :resource, :active, :admin_request)
|
||||||
|
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
click_link(feature.title)
|
click_link(feature.title)
|
||||||
|
|
||||||
create(:dashboard_executed_action, action: feature, proposal: proposal)
|
create(:dashboard_executed_action, action: feature, proposal: proposal)
|
||||||
@@ -141,7 +141,7 @@ feature "Proposal's dashboard" do
|
|||||||
scenario 'Resource without admin request do not have a request link', js: true do
|
scenario 'Resource without admin request do not have a request link', js: true do
|
||||||
feature = create(:dashboard_action, :resource, :active)
|
feature = create(:dashboard_action, :resource, :active)
|
||||||
|
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
click_link(feature.title)
|
click_link(feature.title)
|
||||||
|
|
||||||
expect(page).not_to have_button('Request')
|
expect(page).not_to have_button('Request')
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ feature 'Polls' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
login_as(proposal.author)
|
login_as(proposal.author)
|
||||||
visit proposal_dashboard_index_path(proposal)
|
visit proposal_dashboard_path(proposal)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Has a link to polls feature' do
|
scenario 'Has a link to polls feature' do
|
||||||
|
|||||||
Reference in New Issue
Block a user