Skip to content

Commit

Permalink
Merge pull request #20 from dsalahutdinov/master
Browse files Browse the repository at this point in the history
chore: move back to subjects
  • Loading branch information
wilddima committed Oct 3, 2018
2 parents 08e74ab + e818476 commit a0492bd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions spec/logux/action_caller_spec.rb
Expand Up @@ -13,6 +13,8 @@
end

context 'when action defined' do
subject(:result) { action_caller.call! }

before do
module Actions
class User < Logux::ActionController
Expand All @@ -23,8 +25,6 @@ def add
end
end

let(:result) { action_caller.call! }

after do
Actions::User.send :undef_method, :add
Actions.send :remove_const, :User
Expand Down
6 changes: 3 additions & 3 deletions spec/logux/action_controller_spec.rb
Expand Up @@ -9,7 +9,7 @@
let(:meta) { Logux::Meta.new }

describe '#respond' do
let(:response) { action_controller.respond(:processed) }
subject(:response) { action_controller.respond(:processed) }

it 'returns logux response' do
expect(response).to have_attributes(
Expand All @@ -23,7 +23,7 @@
end

describe '.verify_authorized!' do
let(:verify_authorized!) { described_class.verify_authorized! }
subject(:verify_authorized!) { described_class.verify_authorized! }

around do |example|
Logux.configuration.verify_authorized = false
Expand All @@ -40,7 +40,7 @@
end

describe '.unverify_authorized!' do
let(:unverify_authorized!) { described_class.unverify_authorized! }
subject(:unverify_authorized!) { described_class.unverify_authorized! }

before { Logux.configuration.verify_authorized = true }

Expand Down
2 changes: 1 addition & 1 deletion spec/logux/channel_controller_spec.rb
Expand Up @@ -9,7 +9,7 @@
let(:meta) { Logux::Meta.new }

describe '#subscribe' do
let(:subscribe) { channel_controller.subscribe }
subject(:subscribe) { channel_controller.subscribe }

context 'when ActiveRecord defined' do
it 'tries to find record by chanel data' do
Expand Down
4 changes: 2 additions & 2 deletions spec/logux/class_finder_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:finder) { described_class.new(params) }

describe '#class_name' do
let(:class_name) { finder.class_name }
subject(:class_name) { finder.class_name }

let(:params) { create(:logux_actions_add, type: 'test/test/name/try/user/add') }

Expand All @@ -16,7 +16,7 @@
end

describe '#find_policy_class' do
let(:policy_class) { finder.find_policy_class }
subject(:policy_class) { finder.find_policy_class }

let(:params) { create(:logux_actions_add, type: 'test/test/name/try/user/add') }

Expand Down
4 changes: 2 additions & 2 deletions spec/logux/node_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:node) { described_class.instance }

describe '#generate_action_id' do
let(:action_id) { node.generate_action_id }
subject(:action_id) { node.generate_action_id }

it 'returns correct id' do
expect(action_id).to match(/^[0-9]{13} server:.{8} 0$/)
Expand All @@ -26,7 +26,7 @@
end

describe '#node_id' do
let(:node_id) { node.node_id }
subject(:node_id) { node.node_id }

it 'generates nanoid' do
expect(node_id).not_to be_empty
Expand Down
2 changes: 1 addition & 1 deletion spec/logux/policy_caller_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:policy_caller) { described_class.new(action: action, meta: meta) }

describe '.call!' do
let(:call!) { policy_caller.call! }
subject(:call!) { policy_caller.call! }

let(:action) { Logux::Actions.new(type: 'test/test') }
let(:meta) { {} }
Expand Down
2 changes: 1 addition & 1 deletion spec/logux_spec.rb
Expand Up @@ -16,7 +16,7 @@
end

describe '.generate_action_id' do
let(:action_id) { described_class.generate_action_id }
subject(:action_id) { described_class.generate_action_id }

it 'returns correct action id' do
expect(action_id).not_to be_empty
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/request_from_logux_server_spec.rb
Expand Up @@ -3,7 +3,7 @@
require 'rails_helper'

describe 'Logux response' do
let(:request_logux) do
subject(:request_logux) do
post('/logux',
params: logux_params,
as: :json)
Expand Down

0 comments on commit a0492bd

Please sign in to comment.