Skip to content

Commit

Permalink
Move status#workerstatus to its own controller
Browse files Browse the repository at this point in the history
Refactor StatusController, move worker related actions to
its own controllers
  • Loading branch information
vpereira committed Sep 4, 2018
1 parent ee325c2 commit 36bbce8
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/app/controllers/worker/status_controller.rb
@@ -0,0 +1,5 @@
class Worker::StatusController < ApplicationController
def index
send_data(WorkerStatus.hidden.to_xml)
end
end

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/api/spec/controllers/worker/status_controller_spec.rb
@@ -0,0 +1,18 @@
require 'rails_helper'

RSpec.describe Worker::StatusController, vcr: true do
render_views

let(:user) { create(:confirmed_user) }

before do
login user
end

describe 'GET /index' do
subject! { get :index, params: { format: :xml } }

it { is_expected.to have_http_status(:success) }
it { assert_select 'workerstatus[clients=2]' }
end
end

0 comments on commit 36bbce8

Please sign in to comment.