Skip to content

Commit

Permalink
Remove Bento modals from status messages controller
Browse files Browse the repository at this point in the history
Along with their routes and specs
  • Loading branch information
dmarcoux committed Sep 4, 2019
1 parent 7759d53 commit 8d8a068
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
8 changes: 0 additions & 8 deletions src/api/app/controllers/webui/status_messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ class Webui::StatusMessagesController < Webui::WebuiController
# permissions.status_message_create
before_action :require_admin, only: [:destroy, :create]

def create_status_message_dialog
render_dialog
end

def create
# TODO: make use of permissions.status_message_create
status_message = StatusMessage.new(message: params[:message], severity: params[:severity], user: User.session!)
Expand All @@ -19,10 +15,6 @@ def create
redirect_to(controller: 'main', action: 'index')
end

def destroy_status_message_dialog
render_dialog
end

def destroy
status_message = StatusMessage.find(params[:id])

Expand Down
7 changes: 1 addition & 6 deletions src/api/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ def self.public_or_about_path?(request)
get 'main/systemstatus' => :systemstatus
end

resources :status_messages, only: [:create, :destroy], controller: 'webui/status_messages' do
collection do
get 'create_status_message_dialog' => :create_status_message_dialog
get 'destroy_status_message_dialog' => :destroy_status_message_dialog
end
end
resources :status_messages, only: [:create, :destroy], controller: 'webui/status_messages'

controller 'webui/feeds' do
get 'main/news' => :news, constraints: ->(req) { req.format == :rss }, as: :news_feed
Expand Down
16 changes: 0 additions & 16 deletions src/api/spec/controllers/webui/status_messages_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,4 @@
end
end
end

describe 'GET #create_status_message_dialog' do
before do
get :create_status_message_dialog, xhr: true
end

it { is_expected.to respond_with(:success) }
end

describe 'GET #destroy_status_message_dialog' do
before do
get :destroy_status_message_dialog, xhr: true
end

it { is_expected.to respond_with(:success) }
end
end

0 comments on commit 8d8a068

Please sign in to comment.