Commit d576da37427a8114ba6ea04ff9fc7f8a479f4a56
Committed by
Rafael Manzo
1 parent
2b64da5f
Exists in
colab
and in
4 other branches
Convert specs to RSpec 2.99.0 syntax with Transpec
This conversion is done by Transpec 2.2.1 with the following command:
transpec
* 258 conversions
from: it { should ... }
to: it { is_expected.to ... }
* 82 conversions
from: obj.should
to: expect(obj).to
* 16 conversions
from: describe 'some model' { }
to: describe 'some model', :type => :model { }
* 12 conversions
from: describe 'some controller' { }
to: describe 'some controller', :type => :controller { }
* 11 conversions
from: describe 'some routing' { }
to: describe 'some routing', :type => :routing { }
* 8 conversions
from: describe 'some helper' { }
to: describe 'some helper', :type => :helper { }
* 7 conversions
from: be_false
to: be_falsey
* 6 conversions
from: be_true
to: be_truthy
* 6 conversions
from: it { should_not ... }
to: it { is_expected.not_to ... }
* 4 conversions
from: obj.should_not
to: expect(obj).not_to
For more details: https://github.com/yujinakayama/transpec#supported-conversions
Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
48 changed files
with
397 additions
and
397 deletions
Show diff stats
spec/controllers/base_metric_configurations_controller_spec.rb
| @@ -40,7 +40,7 @@ class InheritsFromBaseMetricConfigurationsController < BaseMetricConfigurationsC | @@ -40,7 +40,7 @@ class InheritsFromBaseMetricConfigurationsController < BaseMetricConfigurationsC | ||
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | -describe InheritsFromBaseMetricConfigurationsController do | 43 | +describe InheritsFromBaseMetricConfigurationsController, :type => :controller do |
| 44 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } | 44 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } |
| 45 | 45 | ||
| 46 | before do | 46 | before do |
| @@ -71,8 +71,8 @@ describe InheritsFromBaseMetricConfigurationsController do | @@ -71,8 +71,8 @@ describe InheritsFromBaseMetricConfigurationsController do | ||
| 71 | get :new, mezuro_configuration_id: mezuro_configuration.id | 71 | get :new, mezuro_configuration_id: mezuro_configuration.id |
| 72 | end | 72 | end |
| 73 | 73 | ||
| 74 | - it { metric_configuration.should_not be_nil } | ||
| 75 | - it { should respond_with(:success) } | 74 | + it { expect(metric_configuration).not_to be_nil } |
| 75 | + it { is_expected.to respond_with(:success) } | ||
| 76 | end | 76 | end |
| 77 | 77 | ||
| 78 | context "when the current user doesn't owns the mezuro configuration" do | 78 | context "when the current user doesn't owns the mezuro configuration" do |
| @@ -80,8 +80,8 @@ describe InheritsFromBaseMetricConfigurationsController do | @@ -80,8 +80,8 @@ describe InheritsFromBaseMetricConfigurationsController do | ||
| 80 | get :new, mezuro_configuration_id: mezuro_configuration.id | 80 | get :new, mezuro_configuration_id: mezuro_configuration.id |
| 81 | end | 81 | end |
| 82 | 82 | ||
| 83 | - it { should redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } | ||
| 84 | - it { should respond_with(:redirect) } | 83 | + it { is_expected.to redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } |
| 84 | + it { is_expected.to respond_with(:redirect) } | ||
| 85 | end | 85 | end |
| 86 | end | 86 | end |
| 87 | 87 | ||
| @@ -104,8 +104,8 @@ describe InheritsFromBaseMetricConfigurationsController do | @@ -104,8 +104,8 @@ describe InheritsFromBaseMetricConfigurationsController do | ||
| 104 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name | 104 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name |
| 105 | end | 105 | end |
| 106 | 106 | ||
| 107 | - it { subject.metric_configuration.should_not be_nil } | ||
| 108 | - it { should respond_with(:success) } | 107 | + it { expect(subject.metric_configuration).not_to be_nil } |
| 108 | + it { is_expected.to respond_with(:success) } | ||
| 109 | end | 109 | end |
| 110 | end | 110 | end |
| 111 | end | 111 | end |
| @@ -124,8 +124,8 @@ describe InheritsFromBaseMetricConfigurationsController do | @@ -124,8 +124,8 @@ describe InheritsFromBaseMetricConfigurationsController do | ||
| 124 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id | 124 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id |
| 125 | end | 125 | end |
| 126 | 126 | ||
| 127 | - it { subject.mezuro_ranges.should_not be_nil} | ||
| 128 | - it { subject.reading_group.should_not be_nil } | 127 | + it { expect(subject.mezuro_ranges).not_to be_nil} |
| 128 | + it { expect(subject.reading_group).not_to be_nil } | ||
| 129 | end | 129 | end |
| 130 | 130 | ||
| 131 | context 'with a invalid metric_configuration' do | 131 | context 'with a invalid metric_configuration' do |
spec/controllers/compound_metric_configurations_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe CompoundMetricConfigurationsController do | 3 | +describe CompoundMetricConfigurationsController, :type => :controller do |
| 4 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } | 4 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } |
| 5 | 5 | ||
| 6 | describe 'new' do | 6 | describe 'new' do |
| @@ -16,8 +16,8 @@ describe CompoundMetricConfigurationsController do | @@ -16,8 +16,8 @@ describe CompoundMetricConfigurationsController do | ||
| 16 | get :new, mezuro_configuration_id: mezuro_configuration.id | 16 | get :new, mezuro_configuration_id: mezuro_configuration.id |
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | - it { should respond_with(:success) } | ||
| 20 | - it { should render_template(:new) } | 19 | + it { is_expected.to respond_with(:success) } |
| 20 | + it { is_expected.to render_template(:new) } | ||
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | context "when the current user doesn't owns the mezuro configuration" do | 23 | context "when the current user doesn't owns the mezuro configuration" do |
| @@ -25,8 +25,8 @@ describe CompoundMetricConfigurationsController do | @@ -25,8 +25,8 @@ describe CompoundMetricConfigurationsController do | ||
| 25 | get :new, mezuro_configuration_id: mezuro_configuration.id | 25 | get :new, mezuro_configuration_id: mezuro_configuration.id |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | - it { should redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } | ||
| 29 | - it { should respond_with(:redirect) } | 28 | + it { is_expected.to redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } |
| 29 | + it { is_expected.to respond_with(:redirect) } | ||
| 30 | end | 30 | end |
| 31 | end | 31 | end |
| 32 | 32 | ||
| @@ -52,7 +52,7 @@ describe CompoundMetricConfigurationsController do | @@ -52,7 +52,7 @@ describe CompoundMetricConfigurationsController do | ||
| 52 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params | 52 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params |
| 53 | end | 53 | end |
| 54 | 54 | ||
| 55 | - it { should respond_with(:redirect) } | 55 | + it { is_expected.to respond_with(:redirect) } |
| 56 | end | 56 | end |
| 57 | 57 | ||
| 58 | context 'with invalid fields' do | 58 | context 'with invalid fields' do |
| @@ -62,7 +62,7 @@ describe CompoundMetricConfigurationsController do | @@ -62,7 +62,7 @@ describe CompoundMetricConfigurationsController do | ||
| 62 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params | 62 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params |
| 63 | end | 63 | end |
| 64 | 64 | ||
| 65 | - it { should render_template(:new) } | 65 | + it { is_expected.to render_template(:new) } |
| 66 | end | 66 | end |
| 67 | end | 67 | end |
| 68 | end | 68 | end |
| @@ -80,7 +80,7 @@ describe CompoundMetricConfigurationsController do | @@ -80,7 +80,7 @@ describe CompoundMetricConfigurationsController do | ||
| 80 | get :show, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s, id: compound_metric_configuration.id | 80 | get :show, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s, id: compound_metric_configuration.id |
| 81 | end | 81 | end |
| 82 | 82 | ||
| 83 | - it { should render_template(:show) } | 83 | + it { is_expected.to render_template(:show) } |
| 84 | end | 84 | end |
| 85 | 85 | ||
| 86 | describe 'edit' do | 86 | describe 'edit' do |
| @@ -99,7 +99,7 @@ describe CompoundMetricConfigurationsController do | @@ -99,7 +99,7 @@ describe CompoundMetricConfigurationsController do | ||
| 99 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s | 99 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s |
| 100 | end | 100 | end |
| 101 | 101 | ||
| 102 | - it { should render_template(:edit) } | 102 | + it { is_expected.to render_template(:edit) } |
| 103 | end | 103 | end |
| 104 | 104 | ||
| 105 | context 'when the user does not own the compound metric configuration' do | 105 | context 'when the user does not own the compound metric configuration' do |
| @@ -107,9 +107,9 @@ describe CompoundMetricConfigurationsController do | @@ -107,9 +107,9 @@ describe CompoundMetricConfigurationsController do | ||
| 107 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s | 107 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s |
| 108 | end | 108 | end |
| 109 | 109 | ||
| 110 | - it { should redirect_to(mezuro_configurations_path(mezuro_configuration.id)) } | ||
| 111 | - it { should respond_with(:redirect) } | ||
| 112 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 110 | + it { is_expected.to redirect_to(mezuro_configurations_path(mezuro_configuration.id)) } |
| 111 | + it { is_expected.to respond_with(:redirect) } | ||
| 112 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 113 | end | 113 | end |
| 114 | end | 114 | end |
| 115 | 115 | ||
| @@ -118,7 +118,7 @@ describe CompoundMetricConfigurationsController do | @@ -118,7 +118,7 @@ describe CompoundMetricConfigurationsController do | ||
| 118 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s | 118 | get :edit, id: compound_metric_configuration.id, mezuro_configuration_id: compound_metric_configuration.configuration_id.to_s |
| 119 | end | 119 | end |
| 120 | 120 | ||
| 121 | - it { should redirect_to new_user_session_path } | 121 | + it { is_expected.to redirect_to new_user_session_path } |
| 122 | end | 122 | end |
| 123 | end | 123 | end |
| 124 | end | 124 | end |
spec/controllers/concerns/ownership_authentication_spec.rb
| @@ -43,7 +43,7 @@ describe OwnershipAuthentication, type: :controller do | @@ -43,7 +43,7 @@ describe OwnershipAuthentication, type: :controller do | ||
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | it 'should return true' do | 45 | it 'should return true' do |
| 46 | - readings_controller.reading_group_owner?.should be_true | 46 | + expect(readings_controller.reading_group_owner?).to be_truthy |
| 47 | end | 47 | end |
| 48 | end | 48 | end |
| 49 | 49 | ||
| @@ -120,7 +120,7 @@ describe OwnershipAuthentication, type: :controller do | @@ -120,7 +120,7 @@ describe OwnershipAuthentication, type: :controller do | ||
| 120 | end | 120 | end |
| 121 | 121 | ||
| 122 | it 'should return true' do | 122 | it 'should return true' do |
| 123 | - repositories_controller.project_owner?.should be_true | 123 | + expect(repositories_controller.project_owner?).to be_truthy |
| 124 | end | 124 | end |
| 125 | end | 125 | end |
| 126 | 126 |
spec/controllers/home_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe HomeController do | 3 | +describe HomeController, :type => :controller do |
| 4 | context 'Method' do | 4 | context 'Method' do |
| 5 | context '#index' do | 5 | context '#index' do |
| 6 | before :each do | 6 | before :each do |
| @@ -9,7 +9,7 @@ describe HomeController do | @@ -9,7 +9,7 @@ describe HomeController do | ||
| 9 | get :index | 9 | get :index |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | - it {should render_template(:index)} | 12 | + it {is_expected.to render_template(:index)} |
| 13 | end | 13 | end |
| 14 | end | 14 | end |
| 15 | end | 15 | end |
spec/controllers/metric_configurations_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MetricConfigurationsController do | 3 | +describe MetricConfigurationsController, :type => :controller do |
| 4 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } | 4 | let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } |
| 5 | describe 'choose_metric' do | 5 | describe 'choose_metric' do |
| 6 | let(:base_tool) { FactoryGirl.build(:base_tool) } | 6 | let(:base_tool) { FactoryGirl.build(:base_tool) } |
| @@ -15,8 +15,8 @@ describe MetricConfigurationsController do | @@ -15,8 +15,8 @@ describe MetricConfigurationsController do | ||
| 15 | get :choose_metric, mezuro_configuration_id: mezuro_configuration.id | 15 | get :choose_metric, mezuro_configuration_id: mezuro_configuration.id |
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | - it { should respond_with(:success) } | ||
| 19 | - it { should render_template(:choose_metric) } | 18 | + it { is_expected.to respond_with(:success) } |
| 19 | + it { is_expected.to render_template(:choose_metric) } | ||
| 20 | end | 20 | end |
| 21 | end | 21 | end |
| 22 | 22 | ||
| @@ -33,8 +33,8 @@ describe MetricConfigurationsController do | @@ -33,8 +33,8 @@ describe MetricConfigurationsController do | ||
| 33 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name | 33 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name |
| 34 | end | 34 | end |
| 35 | 35 | ||
| 36 | - it { should respond_with(:success) } | ||
| 37 | - it { should render_template(:new) } | 36 | + it { is_expected.to respond_with(:success) } |
| 37 | + it { is_expected.to render_template(:new) } | ||
| 38 | end | 38 | end |
| 39 | 39 | ||
| 40 | context "when the current user doesn't owns the mezuro configuration" do | 40 | context "when the current user doesn't owns the mezuro configuration" do |
| @@ -42,8 +42,8 @@ describe MetricConfigurationsController do | @@ -42,8 +42,8 @@ describe MetricConfigurationsController do | ||
| 42 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name | 42 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | - it { should redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } | ||
| 46 | - it { should respond_with(:redirect) } | 45 | + it { is_expected.to redirect_to(mezuro_configurations_url(mezuro_configuration.id)) } |
| 46 | + it { is_expected.to respond_with(:redirect) } | ||
| 47 | end | 47 | end |
| 48 | end | 48 | end |
| 49 | 49 | ||
| @@ -69,7 +69,7 @@ describe MetricConfigurationsController do | @@ -69,7 +69,7 @@ describe MetricConfigurationsController do | ||
| 69 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name | 69 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name |
| 70 | end | 70 | end |
| 71 | 71 | ||
| 72 | - it { should respond_with(:redirect) } | 72 | + it { is_expected.to respond_with(:redirect) } |
| 73 | end | 73 | end |
| 74 | 74 | ||
| 75 | context 'with invalid fields' do | 75 | context 'with invalid fields' do |
| @@ -80,7 +80,7 @@ describe MetricConfigurationsController do | @@ -80,7 +80,7 @@ describe MetricConfigurationsController do | ||
| 80 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name | 80 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name |
| 81 | end | 81 | end |
| 82 | 82 | ||
| 83 | - it { should render_template(:new) } | 83 | + it { is_expected.to render_template(:new) } |
| 84 | end | 84 | end |
| 85 | end | 85 | end |
| 86 | end | 86 | end |
| @@ -98,7 +98,7 @@ describe MetricConfigurationsController do | @@ -98,7 +98,7 @@ describe MetricConfigurationsController do | ||
| 98 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id | 98 | get :show, mezuro_configuration_id: metric_configuration.configuration_id.to_s, id: metric_configuration.id |
| 99 | end | 99 | end |
| 100 | 100 | ||
| 101 | - it { should render_template(:show) } | 101 | + it { is_expected.to render_template(:show) } |
| 102 | end | 102 | end |
| 103 | 103 | ||
| 104 | describe 'edit' do | 104 | describe 'edit' do |
| @@ -116,7 +116,7 @@ describe MetricConfigurationsController do | @@ -116,7 +116,7 @@ describe MetricConfigurationsController do | ||
| 116 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 116 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 117 | end | 117 | end |
| 118 | 118 | ||
| 119 | - it { should render_template(:edit) } | 119 | + it { is_expected.to render_template(:edit) } |
| 120 | end | 120 | end |
| 121 | 121 | ||
| 122 | context 'when the user does not own the metric configuration' do | 122 | context 'when the user does not own the metric configuration' do |
| @@ -124,9 +124,9 @@ describe MetricConfigurationsController do | @@ -124,9 +124,9 @@ describe MetricConfigurationsController do | ||
| 124 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 124 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 125 | end | 125 | end |
| 126 | 126 | ||
| 127 | - it { should redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } | ||
| 128 | - it { should respond_with(:redirect) } | ||
| 129 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 127 | + it { is_expected.to redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } |
| 128 | + it { is_expected.to respond_with(:redirect) } | ||
| 129 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 130 | end | 130 | end |
| 131 | end | 131 | end |
| 132 | 132 | ||
| @@ -135,7 +135,7 @@ describe MetricConfigurationsController do | @@ -135,7 +135,7 @@ describe MetricConfigurationsController do | ||
| 135 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 135 | get :edit, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 136 | end | 136 | end |
| 137 | 137 | ||
| 138 | - it { should redirect_to new_user_session_path } | 138 | + it { is_expected.to redirect_to new_user_session_path } |
| 139 | end | 139 | end |
| 140 | end | 140 | end |
| 141 | 141 | ||
| @@ -161,8 +161,8 @@ describe MetricConfigurationsController do | @@ -161,8 +161,8 @@ describe MetricConfigurationsController do | ||
| 161 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params | 161 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params |
| 162 | end | 162 | end |
| 163 | 163 | ||
| 164 | - it { should redirect_to(mezuro_configuration_path(metric_configuration.configuration_id)) } | ||
| 165 | - it { should respond_with(:redirect) } | 164 | + it { is_expected.to redirect_to(mezuro_configuration_path(metric_configuration.configuration_id)) } |
| 165 | + it { is_expected.to respond_with(:redirect) } | ||
| 166 | end | 166 | end |
| 167 | 167 | ||
| 168 | context 'with an invalid field' do | 168 | context 'with an invalid field' do |
| @@ -173,7 +173,7 @@ describe MetricConfigurationsController do | @@ -173,7 +173,7 @@ describe MetricConfigurationsController do | ||
| 173 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params | 173 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params |
| 174 | end | 174 | end |
| 175 | 175 | ||
| 176 | - it { should render_template(:edit) } | 176 | + it { is_expected.to render_template(:edit) } |
| 177 | end | 177 | end |
| 178 | end | 178 | end |
| 179 | 179 | ||
| @@ -182,7 +182,7 @@ describe MetricConfigurationsController do | @@ -182,7 +182,7 @@ describe MetricConfigurationsController do | ||
| 182 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params | 182 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: metric_configuration.id, metric_configuration: metric_configuration_params |
| 183 | end | 183 | end |
| 184 | 184 | ||
| 185 | - it { should redirect_to mezuro_configurations_path(metric_configuration.configuration_id) } | 185 | + it { is_expected.to redirect_to mezuro_configurations_path(metric_configuration.configuration_id) } |
| 186 | end | 186 | end |
| 187 | end | 187 | end |
| 188 | end | 188 | end |
| @@ -205,8 +205,8 @@ describe MetricConfigurationsController do | @@ -205,8 +205,8 @@ describe MetricConfigurationsController do | ||
| 205 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 205 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 206 | end | 206 | end |
| 207 | 207 | ||
| 208 | - it { should redirect_to(mezuro_configuration_path(metric_configuration.configuration_id)) } | ||
| 209 | - it { should respond_with(:redirect) } | 208 | + it { is_expected.to redirect_to(mezuro_configuration_path(metric_configuration.configuration_id)) } |
| 209 | + it { is_expected.to respond_with(:redirect) } | ||
| 210 | end | 210 | end |
| 211 | 211 | ||
| 212 | context "when the user doesn't own the configuration" do | 212 | context "when the user doesn't own the configuration" do |
| @@ -214,8 +214,8 @@ describe MetricConfigurationsController do | @@ -214,8 +214,8 @@ describe MetricConfigurationsController do | ||
| 214 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 214 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 215 | end | 215 | end |
| 216 | 216 | ||
| 217 | - it { should redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } | ||
| 218 | - it { should respond_with(:redirect) } | 217 | + it { is_expected.to redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } |
| 218 | + it { is_expected.to respond_with(:redirect) } | ||
| 219 | end | 219 | end |
| 220 | end | 220 | end |
| 221 | 221 | ||
| @@ -224,7 +224,7 @@ describe MetricConfigurationsController do | @@ -224,7 +224,7 @@ describe MetricConfigurationsController do | ||
| 224 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: mezuro_configuration.id.to_s | 224 | delete :destroy, id: metric_configuration.id, mezuro_configuration_id: mezuro_configuration.id.to_s |
| 225 | end | 225 | end |
| 226 | 226 | ||
| 227 | - it { should redirect_to new_user_session_path } | 227 | + it { is_expected.to redirect_to new_user_session_path } |
| 228 | end | 228 | end |
| 229 | end | 229 | end |
| 230 | end | 230 | end |
spec/controllers/mezuro_configurations_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroConfigurationsController do | 3 | +describe MezuroConfigurationsController, :type => :controller do |
| 4 | 4 | ||
| 5 | describe 'new' do | 5 | describe 'new' do |
| 6 | before :each do | 6 | before :each do |
| @@ -8,8 +8,8 @@ describe MezuroConfigurationsController do | @@ -8,8 +8,8 @@ describe MezuroConfigurationsController do | ||
| 8 | get :new | 8 | get :new |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | - it { should respond_with(:success) } | ||
| 12 | - it { should render_template(:new) } | 11 | + it { is_expected.to respond_with(:success) } |
| 12 | + it { is_expected.to render_template(:new) } | ||
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | describe 'create' do | 15 | describe 'create' do |
| @@ -33,7 +33,7 @@ describe MezuroConfigurationsController do | @@ -33,7 +33,7 @@ describe MezuroConfigurationsController do | ||
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | it 'should redirect to the show view' do | 35 | it 'should redirect to the show view' do |
| 36 | - response.should redirect_to mezuro_configuration_path(mezuro_configuration) | 36 | + expect(response).to redirect_to mezuro_configuration_path(mezuro_configuration) |
| 37 | end | 37 | end |
| 38 | end | 38 | end |
| 39 | 39 | ||
| @@ -42,7 +42,7 @@ describe MezuroConfigurationsController do | @@ -42,7 +42,7 @@ describe MezuroConfigurationsController do | ||
| 42 | post :create, :mezuro_configuration => subject_params | 42 | post :create, :mezuro_configuration => subject_params |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | - it { should respond_with(:redirect) } | 45 | + it { is_expected.to respond_with(:redirect) } |
| 46 | end | 46 | end |
| 47 | end | 47 | end |
| 48 | 48 | ||
| @@ -57,7 +57,7 @@ describe MezuroConfigurationsController do | @@ -57,7 +57,7 @@ describe MezuroConfigurationsController do | ||
| 57 | post :create, :mezuro_configuration => @subject_params | 57 | post :create, :mezuro_configuration => @subject_params |
| 58 | end | 58 | end |
| 59 | 59 | ||
| 60 | - it { should render_template(:new) } | 60 | + it { is_expected.to render_template(:new) } |
| 61 | end | 61 | end |
| 62 | end | 62 | end |
| 63 | 63 | ||
| @@ -70,7 +70,7 @@ describe MezuroConfigurationsController do | @@ -70,7 +70,7 @@ describe MezuroConfigurationsController do | ||
| 70 | get :show, :id => subject.id | 70 | get :show, :id => subject.id |
| 71 | end | 71 | end |
| 72 | 72 | ||
| 73 | - it { should render_template(:show) } | 73 | + it { is_expected.to render_template(:show) } |
| 74 | end | 74 | end |
| 75 | 75 | ||
| 76 | describe 'destroy' do | 76 | describe 'destroy' do |
| @@ -101,10 +101,10 @@ describe MezuroConfigurationsController do | @@ -101,10 +101,10 @@ describe MezuroConfigurationsController do | ||
| 101 | end | 101 | end |
| 102 | 102 | ||
| 103 | it 'should redirect to the mezuro_configurations page' do | 103 | it 'should redirect to the mezuro_configurations page' do |
| 104 | - response.should redirect_to mezuro_configurations_url | 104 | + expect(response).to redirect_to mezuro_configurations_url |
| 105 | end | 105 | end |
| 106 | 106 | ||
| 107 | - it { should respond_with(:redirect) } | 107 | + it { is_expected.to respond_with(:redirect) } |
| 108 | end | 108 | end |
| 109 | 109 | ||
| 110 | context "when the user doesn't own the mezuro_configuration" do | 110 | context "when the user doesn't own the mezuro_configuration" do |
| @@ -115,7 +115,7 @@ describe MezuroConfigurationsController do | @@ -115,7 +115,7 @@ describe MezuroConfigurationsController do | ||
| 115 | delete :destroy, :id => @subject.id | 115 | delete :destroy, :id => @subject.id |
| 116 | end | 116 | end |
| 117 | 117 | ||
| 118 | - it { should redirect_to(mezuro_configurations_path(@subject.id)) } | 118 | + it { is_expected.to redirect_to(mezuro_configurations_path(@subject.id)) } |
| 119 | end | 119 | end |
| 120 | end | 120 | end |
| 121 | 121 | ||
| @@ -124,7 +124,7 @@ describe MezuroConfigurationsController do | @@ -124,7 +124,7 @@ describe MezuroConfigurationsController do | ||
| 124 | delete :destroy, :id => @subject.id | 124 | delete :destroy, :id => @subject.id |
| 125 | end | 125 | end |
| 126 | 126 | ||
| 127 | - it { should redirect_to new_user_session_path } | 127 | + it { is_expected.to redirect_to new_user_session_path } |
| 128 | end | 128 | end |
| 129 | end | 129 | end |
| 130 | 130 | ||
| @@ -135,7 +135,7 @@ describe MezuroConfigurationsController do | @@ -135,7 +135,7 @@ describe MezuroConfigurationsController do | ||
| 135 | get :index | 135 | get :index |
| 136 | end | 136 | end |
| 137 | 137 | ||
| 138 | - it { should render_template(:index) } | 138 | + it { is_expected.to render_template(:index) } |
| 139 | end | 139 | end |
| 140 | 140 | ||
| 141 | describe 'edit' do | 141 | describe 'edit' do |
| @@ -162,10 +162,10 @@ describe MezuroConfigurationsController do | @@ -162,10 +162,10 @@ describe MezuroConfigurationsController do | ||
| 162 | get :edit, :id => @subject.id | 162 | get :edit, :id => @subject.id |
| 163 | end | 163 | end |
| 164 | 164 | ||
| 165 | - it { should render_template(:edit) } | 165 | + it { is_expected.to render_template(:edit) } |
| 166 | 166 | ||
| 167 | it 'should assign to @mezuro_configuration the @subject' do | 167 | it 'should assign to @mezuro_configuration the @subject' do |
| 168 | - assigns(:mezuro_configuration).should eq(@subject) | 168 | + expect(assigns(:mezuro_configuration)).to eq(@subject) |
| 169 | end | 169 | end |
| 170 | end | 170 | end |
| 171 | 171 | ||
| @@ -177,8 +177,8 @@ describe MezuroConfigurationsController do | @@ -177,8 +177,8 @@ describe MezuroConfigurationsController do | ||
| 177 | get :edit, :id => @subject.id | 177 | get :edit, :id => @subject.id |
| 178 | end | 178 | end |
| 179 | 179 | ||
| 180 | - it { should redirect_to(mezuro_configurations_path(@subject.id)) } | ||
| 181 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 180 | + it { is_expected.to redirect_to(mezuro_configurations_path(@subject.id)) } |
| 181 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 182 | end | 182 | end |
| 183 | end | 183 | end |
| 184 | 184 | ||
| @@ -187,7 +187,7 @@ describe MezuroConfigurationsController do | @@ -187,7 +187,7 @@ describe MezuroConfigurationsController do | ||
| 187 | get :edit, :id => @subject.id | 187 | get :edit, :id => @subject.id |
| 188 | end | 188 | end |
| 189 | 189 | ||
| 190 | - it { should redirect_to new_user_session_path } | 190 | + it { is_expected.to redirect_to new_user_session_path } |
| 191 | end | 191 | end |
| 192 | end | 192 | end |
| 193 | 193 | ||
| @@ -225,7 +225,7 @@ describe MezuroConfigurationsController do | @@ -225,7 +225,7 @@ describe MezuroConfigurationsController do | ||
| 225 | end | 225 | end |
| 226 | 226 | ||
| 227 | it 'should redirect to the show view' do | 227 | it 'should redirect to the show view' do |
| 228 | - response.should redirect_to mezuro_configuration_path(@subject) | 228 | + expect(response).to redirect_to mezuro_configuration_path(@subject) |
| 229 | end | 229 | end |
| 230 | end | 230 | end |
| 231 | 231 | ||
| @@ -234,7 +234,7 @@ describe MezuroConfigurationsController do | @@ -234,7 +234,7 @@ describe MezuroConfigurationsController do | ||
| 234 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params | 234 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params |
| 235 | end | 235 | end |
| 236 | 236 | ||
| 237 | - it { should respond_with(:redirect) } | 237 | + it { is_expected.to respond_with(:redirect) } |
| 238 | end | 238 | end |
| 239 | end | 239 | end |
| 240 | 240 | ||
| @@ -246,7 +246,7 @@ describe MezuroConfigurationsController do | @@ -246,7 +246,7 @@ describe MezuroConfigurationsController do | ||
| 246 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params | 246 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params |
| 247 | end | 247 | end |
| 248 | 248 | ||
| 249 | - it { should render_template(:edit) } | 249 | + it { is_expected.to render_template(:edit) } |
| 250 | end | 250 | end |
| 251 | end | 251 | end |
| 252 | 252 | ||
| @@ -255,7 +255,7 @@ describe MezuroConfigurationsController do | @@ -255,7 +255,7 @@ describe MezuroConfigurationsController do | ||
| 255 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params | 255 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params |
| 256 | end | 256 | end |
| 257 | 257 | ||
| 258 | - it { should redirect_to mezuro_configurations_path(@subject.id) } | 258 | + it { is_expected.to redirect_to mezuro_configurations_path(@subject.id) } |
| 259 | end | 259 | end |
| 260 | end | 260 | end |
| 261 | 261 | ||
| @@ -264,7 +264,7 @@ describe MezuroConfigurationsController do | @@ -264,7 +264,7 @@ describe MezuroConfigurationsController do | ||
| 264 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params | 264 | post :update, :id => @subject.id, :mezuro_configuration => @subject_params |
| 265 | end | 265 | end |
| 266 | 266 | ||
| 267 | - it { should redirect_to new_user_session_path } | 267 | + it { is_expected.to redirect_to new_user_session_path } |
| 268 | end | 268 | end |
| 269 | end | 269 | end |
| 270 | end | 270 | end |
spec/controllers/mezuro_ranges_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroRangesController do | 3 | +describe MezuroRangesController, :type => :controller do |
| 4 | let(:mezuro_range) { FactoryGirl.build(:mezuro_range, id: 1) } | 4 | let(:mezuro_range) { FactoryGirl.build(:mezuro_range, id: 1) } |
| 5 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } | 5 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } |
| 6 | 6 | ||
| @@ -19,8 +19,8 @@ describe MezuroRangesController do | @@ -19,8 +19,8 @@ describe MezuroRangesController do | ||
| 19 | get :new, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: mezuro_range.metric_configuration_id | 19 | get :new, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: mezuro_range.metric_configuration_id |
| 20 | end | 20 | end |
| 21 | 21 | ||
| 22 | - it { should respond_with(:success) } | ||
| 23 | - it { should render_template(:new) } | 22 | + it { is_expected.to respond_with(:success) } |
| 23 | + it { is_expected.to render_template(:new) } | ||
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | context "when the current user doesn't owns the metric configuration" do | 26 | context "when the current user doesn't owns the metric configuration" do |
| @@ -28,8 +28,8 @@ describe MezuroRangesController do | @@ -28,8 +28,8 @@ describe MezuroRangesController do | ||
| 28 | get :new, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: mezuro_range.metric_configuration_id | 28 | get :new, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: mezuro_range.metric_configuration_id |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | - it { should redirect_to(mezuro_configurations_path(mezuro_configuration.id)) } | ||
| 32 | - it { should respond_with(:redirect) } | 31 | + it { is_expected.to redirect_to(mezuro_configurations_path(mezuro_configuration.id)) } |
| 32 | + it { is_expected.to respond_with(:redirect) } | ||
| 33 | end | 33 | end |
| 34 | end | 34 | end |
| 35 | 35 | ||
| @@ -53,7 +53,7 @@ describe MezuroRangesController do | @@ -53,7 +53,7 @@ describe MezuroRangesController do | ||
| 53 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params | 53 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | - it { should respond_with(:redirect) } | 56 | + it { is_expected.to respond_with(:redirect) } |
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | context 'with invalid fields' do | 59 | context 'with invalid fields' do |
| @@ -65,7 +65,7 @@ describe MezuroRangesController do | @@ -65,7 +65,7 @@ describe MezuroRangesController do | ||
| 65 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params | 65 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params |
| 66 | end | 66 | end |
| 67 | 67 | ||
| 68 | - it { should render_template(:new) } | 68 | + it { is_expected.to render_template(:new) } |
| 69 | end | 69 | end |
| 70 | end | 70 | end |
| 71 | end | 71 | end |
| @@ -85,8 +85,8 @@ describe MezuroRangesController do | @@ -85,8 +85,8 @@ describe MezuroRangesController do | ||
| 85 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 85 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 86 | end | 86 | end |
| 87 | 87 | ||
| 88 | - it { should redirect_to(mezuro_configuration_metric_configuration_path(metric_configuration.configuration_id, metric_configuration.id)) } | ||
| 89 | - it { should respond_with(:redirect) } | 88 | + it { is_expected.to redirect_to(mezuro_configuration_metric_configuration_path(metric_configuration.configuration_id, metric_configuration.id)) } |
| 89 | + it { is_expected.to respond_with(:redirect) } | ||
| 90 | end | 90 | end |
| 91 | 91 | ||
| 92 | context "when the user doesn't own the metric configuration" do | 92 | context "when the user doesn't own the metric configuration" do |
| @@ -94,8 +94,8 @@ describe MezuroRangesController do | @@ -94,8 +94,8 @@ describe MezuroRangesController do | ||
| 94 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 94 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 95 | end | 95 | end |
| 96 | 96 | ||
| 97 | - it { should redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } | ||
| 98 | - it { should respond_with(:redirect) } | 97 | + it { is_expected.to redirect_to(mezuro_configurations_path(metric_configuration.configuration_id)) } |
| 98 | + it { is_expected.to respond_with(:redirect) } | ||
| 99 | end | 99 | end |
| 100 | end | 100 | end |
| 101 | 101 | ||
| @@ -104,7 +104,7 @@ describe MezuroRangesController do | @@ -104,7 +104,7 @@ describe MezuroRangesController do | ||
| 104 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s | 104 | delete :destroy, id: mezuro_range.id.to_s, metric_configuration_id: metric_configuration.id.to_s, mezuro_configuration_id: metric_configuration.configuration_id.to_s |
| 105 | end | 105 | end |
| 106 | 106 | ||
| 107 | - it { should redirect_to new_user_session_path } | 107 | + it { is_expected.to redirect_to new_user_session_path } |
| 108 | end | 108 | end |
| 109 | end | 109 | end |
| 110 | 110 | ||
| @@ -127,7 +127,7 @@ describe MezuroRangesController do | @@ -127,7 +127,7 @@ describe MezuroRangesController do | ||
| 127 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id | 127 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id |
| 128 | end | 128 | end |
| 129 | 129 | ||
| 130 | - it { should render_template(:edit) } | 130 | + it { is_expected.to render_template(:edit) } |
| 131 | end | 131 | end |
| 132 | 132 | ||
| 133 | context 'when the user does not own the mezuro range' do | 133 | context 'when the user does not own the mezuro range' do |
| @@ -137,9 +137,9 @@ describe MezuroRangesController do | @@ -137,9 +137,9 @@ describe MezuroRangesController do | ||
| 137 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id | 137 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id |
| 138 | end | 138 | end |
| 139 | 139 | ||
| 140 | - it { should redirect_to(mezuro_configurations_url(metric_configuration.configuration_id)) } | ||
| 141 | - it { should respond_with(:redirect) } | ||
| 142 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 140 | + it { is_expected.to redirect_to(mezuro_configurations_url(metric_configuration.configuration_id)) } |
| 141 | + it { is_expected.to respond_with(:redirect) } | ||
| 142 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 143 | end | 143 | end |
| 144 | end | 144 | end |
| 145 | 145 | ||
| @@ -148,7 +148,7 @@ describe MezuroRangesController do | @@ -148,7 +148,7 @@ describe MezuroRangesController do | ||
| 148 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id | 148 | get :edit, id: mezuro_range.id, mezuro_configuration_id: metric_configuration.configuration_id, metric_configuration_id: metric_configuration.id |
| 149 | end | 149 | end |
| 150 | 150 | ||
| 151 | - it { should redirect_to new_user_session_path } | 151 | + it { is_expected.to redirect_to new_user_session_path } |
| 152 | end | 152 | end |
| 153 | end | 153 | end |
| 154 | 154 | ||
| @@ -176,8 +176,8 @@ describe MezuroRangesController do | @@ -176,8 +176,8 @@ describe MezuroRangesController do | ||
| 176 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params | 176 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params |
| 177 | end | 177 | end |
| 178 | 178 | ||
| 179 | - it { should redirect_to(mezuro_configuration_metric_configuration_path(metric_configuration.configuration_id, metric_configuration.id)) } | ||
| 180 | - it { should respond_with(:redirect) } | 179 | + it { is_expected.to redirect_to(mezuro_configuration_metric_configuration_path(metric_configuration.configuration_id, metric_configuration.id)) } |
| 180 | + it { is_expected.to respond_with(:redirect) } | ||
| 181 | end | 181 | end |
| 182 | 182 | ||
| 183 | context 'with an invalid field' do | 183 | context 'with an invalid field' do |
| @@ -190,7 +190,7 @@ describe MezuroRangesController do | @@ -190,7 +190,7 @@ describe MezuroRangesController do | ||
| 190 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params | 190 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params |
| 191 | end | 191 | end |
| 192 | 192 | ||
| 193 | - it { should render_template(:edit) } | 193 | + it { is_expected.to render_template(:edit) } |
| 194 | end | 194 | end |
| 195 | end | 195 | end |
| 196 | 196 | ||
| @@ -199,7 +199,7 @@ describe MezuroRangesController do | @@ -199,7 +199,7 @@ describe MezuroRangesController do | ||
| 199 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params | 199 | post :update, mezuro_configuration_id: metric_configuration.configuration_id, id: mezuro_range.id, metric_configuration_id: metric_configuration.id, mezuro_range: mezuro_range_params |
| 200 | end | 200 | end |
| 201 | 201 | ||
| 202 | - it { should redirect_to mezuro_configurations_path(metric_configuration.configuration_id) } | 202 | + it { is_expected.to redirect_to mezuro_configurations_path(metric_configuration.configuration_id) } |
| 203 | end | 203 | end |
| 204 | end | 204 | end |
| 205 | end | 205 | end |
spec/controllers/modules_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ModulesController do | 3 | +describe ModulesController, :type => :controller do |
| 4 | describe "load_module_tree" do | 4 | describe "load_module_tree" do |
| 5 | before :each do | 5 | before :each do |
| 6 | ModuleResult.expects(:find).with(42).returns(FactoryGirl.build(:module_result)) | 6 | ModuleResult.expects(:find).with(42).returns(FactoryGirl.build(:module_result)) |
| @@ -8,8 +8,8 @@ describe ModulesController do | @@ -8,8 +8,8 @@ describe ModulesController do | ||
| 8 | post :load_module_tree, id: 42, format: :js | 8 | post :load_module_tree, id: 42, format: :js |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | - it { should respond_with(:success) } | ||
| 12 | - it { should render_template(:load_module_tree) } | 11 | + it { is_expected.to respond_with(:success) } |
| 12 | + it { is_expected.to render_template(:load_module_tree) } | ||
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | describe "metric_history" do | 15 | describe "metric_history" do |
| @@ -26,7 +26,7 @@ describe ModulesController do | @@ -26,7 +26,7 @@ describe ModulesController do | ||
| 26 | xhr :get, :metric_history, {id: module_result.id, metric_name: metric_name, module_id: module_id} | 26 | xhr :get, :metric_history, {id: module_result.id, metric_name: metric_name, module_id: module_id} |
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | - it { should respond_with(:success) } | ||
| 30 | - it { should render_template(:metric_history) } | 29 | + it { is_expected.to respond_with(:success) } |
| 30 | + it { is_expected.to render_template(:metric_history) } | ||
| 31 | end | 31 | end |
| 32 | end | 32 | end |
| 33 | \ No newline at end of file | 33 | \ No newline at end of file |
spec/controllers/projects_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ProjectsController do | 3 | +describe ProjectsController, :type => :controller do |
| 4 | 4 | ||
| 5 | describe 'new' do | 5 | describe 'new' do |
| 6 | before :each do | 6 | before :each do |
| @@ -8,8 +8,8 @@ describe ProjectsController do | @@ -8,8 +8,8 @@ describe ProjectsController do | ||
| 8 | get :new | 8 | get :new |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | - it { should respond_with(:success) } | ||
| 12 | - it { should render_template(:new) } | 11 | + it { is_expected.to respond_with(:success) } |
| 12 | + it { is_expected.to render_template(:new) } | ||
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | describe 'create' do | 15 | describe 'create' do |
| @@ -33,7 +33,7 @@ describe ProjectsController do | @@ -33,7 +33,7 @@ describe ProjectsController do | ||
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | it 'should redirect to the show view' do | 35 | it 'should redirect to the show view' do |
| 36 | - response.should redirect_to project_path(project) | 36 | + expect(response).to redirect_to project_path(project) |
| 37 | end | 37 | end |
| 38 | end | 38 | end |
| 39 | 39 | ||
| @@ -42,7 +42,7 @@ describe ProjectsController do | @@ -42,7 +42,7 @@ describe ProjectsController do | ||
| 42 | post :create, :project => subject_params | 42 | post :create, :project => subject_params |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | - it { should respond_with(:redirect) } | 45 | + it { is_expected.to respond_with(:redirect) } |
| 46 | end | 46 | end |
| 47 | end | 47 | end |
| 48 | 48 | ||
| @@ -57,7 +57,7 @@ describe ProjectsController do | @@ -57,7 +57,7 @@ describe ProjectsController do | ||
| 57 | post :create, :project => @subject_params | 57 | post :create, :project => @subject_params |
| 58 | end | 58 | end |
| 59 | 59 | ||
| 60 | - it { should render_template(:new) } | 60 | + it { is_expected.to render_template(:new) } |
| 61 | end | 61 | end |
| 62 | end | 62 | end |
| 63 | 63 | ||
| @@ -70,7 +70,7 @@ describe ProjectsController do | @@ -70,7 +70,7 @@ describe ProjectsController do | ||
| 70 | get :show, :id => subject.id | 70 | get :show, :id => subject.id |
| 71 | end | 71 | end |
| 72 | 72 | ||
| 73 | - it { should render_template(:show) } | 73 | + it { is_expected.to render_template(:show) } |
| 74 | end | 74 | end |
| 75 | 75 | ||
| 76 | describe 'destroy' do | 76 | describe 'destroy' do |
| @@ -102,10 +102,10 @@ describe ProjectsController do | @@ -102,10 +102,10 @@ describe ProjectsController do | ||
| 102 | end | 102 | end |
| 103 | 103 | ||
| 104 | it 'should redirect to the projects page' do | 104 | it 'should redirect to the projects page' do |
| 105 | - response.should redirect_to projects_url | 105 | + expect(response).to redirect_to projects_url |
| 106 | end | 106 | end |
| 107 | 107 | ||
| 108 | - it { should respond_with(:redirect) } | 108 | + it { is_expected.to respond_with(:redirect) } |
| 109 | end | 109 | end |
| 110 | 110 | ||
| 111 | context "when the user doesn't own the project" do | 111 | context "when the user doesn't own the project" do |
| @@ -116,7 +116,7 @@ describe ProjectsController do | @@ -116,7 +116,7 @@ describe ProjectsController do | ||
| 116 | delete :destroy, :id => @subject.id | 116 | delete :destroy, :id => @subject.id |
| 117 | end | 117 | end |
| 118 | 118 | ||
| 119 | - it { should redirect_to(projects_path) } | 119 | + it { is_expected.to redirect_to(projects_path) } |
| 120 | end | 120 | end |
| 121 | end | 121 | end |
| 122 | 122 | ||
| @@ -125,7 +125,7 @@ describe ProjectsController do | @@ -125,7 +125,7 @@ describe ProjectsController do | ||
| 125 | delete :destroy, :id => @subject.id | 125 | delete :destroy, :id => @subject.id |
| 126 | end | 126 | end |
| 127 | 127 | ||
| 128 | - it { should redirect_to new_user_session_path } | 128 | + it { is_expected.to redirect_to new_user_session_path } |
| 129 | end | 129 | end |
| 130 | end | 130 | end |
| 131 | 131 | ||
| @@ -136,7 +136,7 @@ describe ProjectsController do | @@ -136,7 +136,7 @@ describe ProjectsController do | ||
| 136 | get :index | 136 | get :index |
| 137 | end | 137 | end |
| 138 | 138 | ||
| 139 | - it { should render_template(:index) } | 139 | + it { is_expected.to render_template(:index) } |
| 140 | end | 140 | end |
| 141 | 141 | ||
| 142 | describe 'edit' do | 142 | describe 'edit' do |
| @@ -163,10 +163,10 @@ describe ProjectsController do | @@ -163,10 +163,10 @@ describe ProjectsController do | ||
| 163 | get :edit, :id => @subject.id | 163 | get :edit, :id => @subject.id |
| 164 | end | 164 | end |
| 165 | 165 | ||
| 166 | - it { should render_template(:edit) } | 166 | + it { is_expected.to render_template(:edit) } |
| 167 | 167 | ||
| 168 | it 'should assign to @project the @subject' do | 168 | it 'should assign to @project the @subject' do |
| 169 | - assigns(:project).should eq(@subject) | 169 | + expect(assigns(:project)).to eq(@subject) |
| 170 | end | 170 | end |
| 171 | end | 171 | end |
| 172 | 172 | ||
| @@ -178,8 +178,8 @@ describe ProjectsController do | @@ -178,8 +178,8 @@ describe ProjectsController do | ||
| 178 | get :edit, :id => @subject.id | 178 | get :edit, :id => @subject.id |
| 179 | end | 179 | end |
| 180 | 180 | ||
| 181 | - it { should redirect_to(projects_path) } | ||
| 182 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 181 | + it { is_expected.to redirect_to(projects_path) } |
| 182 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 183 | end | 183 | end |
| 184 | end | 184 | end |
| 185 | 185 | ||
| @@ -188,7 +188,7 @@ describe ProjectsController do | @@ -188,7 +188,7 @@ describe ProjectsController do | ||
| 188 | get :edit, :id => @subject.id | 188 | get :edit, :id => @subject.id |
| 189 | end | 189 | end |
| 190 | 190 | ||
| 191 | - it { should redirect_to new_user_session_path } | 191 | + it { is_expected.to redirect_to new_user_session_path } |
| 192 | end | 192 | end |
| 193 | end | 193 | end |
| 194 | 194 | ||
| @@ -226,7 +226,7 @@ describe ProjectsController do | @@ -226,7 +226,7 @@ describe ProjectsController do | ||
| 226 | end | 226 | end |
| 227 | 227 | ||
| 228 | it 'should redirect to the show view' do | 228 | it 'should redirect to the show view' do |
| 229 | - response.should redirect_to project_path(@subject) | 229 | + expect(response).to redirect_to project_path(@subject) |
| 230 | end | 230 | end |
| 231 | end | 231 | end |
| 232 | 232 | ||
| @@ -235,7 +235,7 @@ describe ProjectsController do | @@ -235,7 +235,7 @@ describe ProjectsController do | ||
| 235 | post :update, :id => @subject.id, :project => @subject_params | 235 | post :update, :id => @subject.id, :project => @subject_params |
| 236 | end | 236 | end |
| 237 | 237 | ||
| 238 | - it { should respond_with(:redirect) } | 238 | + it { is_expected.to respond_with(:redirect) } |
| 239 | end | 239 | end |
| 240 | end | 240 | end |
| 241 | 241 | ||
| @@ -247,7 +247,7 @@ describe ProjectsController do | @@ -247,7 +247,7 @@ describe ProjectsController do | ||
| 247 | post :update, :id => @subject.id, :project => @subject_params | 247 | post :update, :id => @subject.id, :project => @subject_params |
| 248 | end | 248 | end |
| 249 | 249 | ||
| 250 | - it { should render_template(:edit) } | 250 | + it { is_expected.to render_template(:edit) } |
| 251 | end | 251 | end |
| 252 | end | 252 | end |
| 253 | 253 | ||
| @@ -256,7 +256,7 @@ describe ProjectsController do | @@ -256,7 +256,7 @@ describe ProjectsController do | ||
| 256 | post :update, :id => @subject.id, :project => @subject_params | 256 | post :update, :id => @subject.id, :project => @subject_params |
| 257 | end | 257 | end |
| 258 | 258 | ||
| 259 | - it { should redirect_to projects_path } | 259 | + it { is_expected.to redirect_to projects_path } |
| 260 | end | 260 | end |
| 261 | end | 261 | end |
| 262 | 262 | ||
| @@ -265,7 +265,7 @@ describe ProjectsController do | @@ -265,7 +265,7 @@ describe ProjectsController do | ||
| 265 | post :update, :id => @subject.id, :project => @subject_params | 265 | post :update, :id => @subject.id, :project => @subject_params |
| 266 | end | 266 | end |
| 267 | 267 | ||
| 268 | - it { should redirect_to new_user_session_path } | 268 | + it { is_expected.to redirect_to new_user_session_path } |
| 269 | end | 269 | end |
| 270 | end | 270 | end |
| 271 | end | 271 | end |
spec/controllers/reading_groups_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ReadingGroupsController do | 3 | +describe ReadingGroupsController, :type => :controller do |
| 4 | describe 'new' do | 4 | describe 'new' do |
| 5 | before :each do | 5 | before :each do |
| 6 | sign_in FactoryGirl.create(:user) | 6 | sign_in FactoryGirl.create(:user) |
| 7 | get :new | 7 | get :new |
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | - it { should respond_with(:success) } | ||
| 11 | - it { should render_template(:new) } | 10 | + it { is_expected.to respond_with(:success) } |
| 11 | + it { is_expected.to render_template(:new) } | ||
| 12 | end | 12 | end |
| 13 | 13 | ||
| 14 | describe 'create' do | 14 | describe 'create' do |
| @@ -32,7 +32,7 @@ describe ReadingGroupsController do | @@ -32,7 +32,7 @@ describe ReadingGroupsController do | ||
| 32 | end | 32 | end |
| 33 | 33 | ||
| 34 | it 'should redirect to the show view' do | 34 | it 'should redirect to the show view' do |
| 35 | - response.should redirect_to reading_group_path(reading_group) | 35 | + expect(response).to redirect_to reading_group_path(reading_group) |
| 36 | end | 36 | end |
| 37 | end | 37 | end |
| 38 | 38 | ||
| @@ -41,7 +41,7 @@ describe ReadingGroupsController do | @@ -41,7 +41,7 @@ describe ReadingGroupsController do | ||
| 41 | post :create, :reading_group => subject_params | 41 | post :create, :reading_group => subject_params |
| 42 | end | 42 | end |
| 43 | 43 | ||
| 44 | - it { should respond_with(:redirect) } | 44 | + it { is_expected.to respond_with(:redirect) } |
| 45 | end | 45 | end |
| 46 | end | 46 | end |
| 47 | 47 | ||
| @@ -56,7 +56,7 @@ describe ReadingGroupsController do | @@ -56,7 +56,7 @@ describe ReadingGroupsController do | ||
| 56 | post :create, :reading_group => @subject_params | 56 | post :create, :reading_group => @subject_params |
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | - it { should render_template(:new) } | 59 | + it { is_expected.to render_template(:new) } |
| 60 | end | 60 | end |
| 61 | end | 61 | end |
| 62 | 62 | ||
| @@ -68,7 +68,7 @@ describe ReadingGroupsController do | @@ -68,7 +68,7 @@ describe ReadingGroupsController do | ||
| 68 | get :show, :id => subject.id | 68 | get :show, :id => subject.id |
| 69 | end | 69 | end |
| 70 | 70 | ||
| 71 | - it { should render_template(:show) } | 71 | + it { is_expected.to render_template(:show) } |
| 72 | end | 72 | end |
| 73 | 73 | ||
| 74 | describe 'destroy' do | 74 | describe 'destroy' do |
| @@ -100,10 +100,10 @@ describe ReadingGroupsController do | @@ -100,10 +100,10 @@ describe ReadingGroupsController do | ||
| 100 | end | 100 | end |
| 101 | 101 | ||
| 102 | it 'should redirect to the reading groups page' do | 102 | it 'should redirect to the reading groups page' do |
| 103 | - response.should redirect_to reading_groups_url | 103 | + expect(response).to redirect_to reading_groups_url |
| 104 | end | 104 | end |
| 105 | 105 | ||
| 106 | - it { should respond_with(:redirect) } | 106 | + it { is_expected.to respond_with(:redirect) } |
| 107 | end | 107 | end |
| 108 | 108 | ||
| 109 | context "when the user doesn't own the reading group" do | 109 | context "when the user doesn't own the reading group" do |
| @@ -114,7 +114,7 @@ describe ReadingGroupsController do | @@ -114,7 +114,7 @@ describe ReadingGroupsController do | ||
| 114 | delete :destroy, :id => @subject.id | 114 | delete :destroy, :id => @subject.id |
| 115 | end | 115 | end |
| 116 | 116 | ||
| 117 | - it { should redirect_to(reading_group_path) } | 117 | + it { is_expected.to redirect_to(reading_group_path) } |
| 118 | end | 118 | end |
| 119 | end | 119 | end |
| 120 | 120 | ||
| @@ -123,7 +123,7 @@ describe ReadingGroupsController do | @@ -123,7 +123,7 @@ describe ReadingGroupsController do | ||
| 123 | delete :destroy, :id => @subject.id | 123 | delete :destroy, :id => @subject.id |
| 124 | end | 124 | end |
| 125 | 125 | ||
| 126 | - it { should redirect_to new_user_session_path } | 126 | + it { is_expected.to redirect_to new_user_session_path } |
| 127 | end | 127 | end |
| 128 | end | 128 | end |
| 129 | 129 | ||
| @@ -134,7 +134,7 @@ describe ReadingGroupsController do | @@ -134,7 +134,7 @@ describe ReadingGroupsController do | ||
| 134 | get :index | 134 | get :index |
| 135 | end | 135 | end |
| 136 | 136 | ||
| 137 | - it { should render_template(:index) } | 137 | + it { is_expected.to render_template(:index) } |
| 138 | end | 138 | end |
| 139 | 139 | ||
| 140 | describe 'edit' do | 140 | describe 'edit' do |
| @@ -161,10 +161,10 @@ describe ReadingGroupsController do | @@ -161,10 +161,10 @@ describe ReadingGroupsController do | ||
| 161 | get :edit, :id => @subject.id | 161 | get :edit, :id => @subject.id |
| 162 | end | 162 | end |
| 163 | 163 | ||
| 164 | - it { should render_template(:edit) } | 164 | + it { is_expected.to render_template(:edit) } |
| 165 | 165 | ||
| 166 | it 'should assign to @reading group the @subject' do | 166 | it 'should assign to @reading group the @subject' do |
| 167 | - assigns(:reading_group).should eq(@subject) | 167 | + expect(assigns(:reading_group)).to eq(@subject) |
| 168 | end | 168 | end |
| 169 | end | 169 | end |
| 170 | 170 | ||
| @@ -176,8 +176,8 @@ describe ReadingGroupsController do | @@ -176,8 +176,8 @@ describe ReadingGroupsController do | ||
| 176 | get :edit, :id => @subject.id | 176 | get :edit, :id => @subject.id |
| 177 | end | 177 | end |
| 178 | 178 | ||
| 179 | - it { should redirect_to(reading_group_path) } | ||
| 180 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 179 | + it { is_expected.to redirect_to(reading_group_path) } |
| 180 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 181 | end | 181 | end |
| 182 | end | 182 | end |
| 183 | 183 | ||
| @@ -186,7 +186,7 @@ describe ReadingGroupsController do | @@ -186,7 +186,7 @@ describe ReadingGroupsController do | ||
| 186 | get :edit, :id => @subject.id | 186 | get :edit, :id => @subject.id |
| 187 | end | 187 | end |
| 188 | 188 | ||
| 189 | - it { should redirect_to new_user_session_path } | 189 | + it { is_expected.to redirect_to new_user_session_path } |
| 190 | end | 190 | end |
| 191 | end | 191 | end |
| 192 | 192 | ||
| @@ -224,7 +224,7 @@ describe ReadingGroupsController do | @@ -224,7 +224,7 @@ describe ReadingGroupsController do | ||
| 224 | end | 224 | end |
| 225 | 225 | ||
| 226 | it 'should redirect to the show view' do | 226 | it 'should redirect to the show view' do |
| 227 | - response.should redirect_to reading_group_path(@subject) | 227 | + expect(response).to redirect_to reading_group_path(@subject) |
| 228 | end | 228 | end |
| 229 | end | 229 | end |
| 230 | 230 | ||
| @@ -233,7 +233,7 @@ describe ReadingGroupsController do | @@ -233,7 +233,7 @@ describe ReadingGroupsController do | ||
| 233 | post :update, :id => @subject.id, :reading_group => @subject_params | 233 | post :update, :id => @subject.id, :reading_group => @subject_params |
| 234 | end | 234 | end |
| 235 | 235 | ||
| 236 | - it { should respond_with(:redirect) } | 236 | + it { is_expected.to respond_with(:redirect) } |
| 237 | end | 237 | end |
| 238 | end | 238 | end |
| 239 | 239 | ||
| @@ -245,7 +245,7 @@ describe ReadingGroupsController do | @@ -245,7 +245,7 @@ describe ReadingGroupsController do | ||
| 245 | post :update, :id => @subject.id, :reading_group => @subject_params | 245 | post :update, :id => @subject.id, :reading_group => @subject_params |
| 246 | end | 246 | end |
| 247 | 247 | ||
| 248 | - it { should render_template(:edit) } | 248 | + it { is_expected.to render_template(:edit) } |
| 249 | end | 249 | end |
| 250 | end | 250 | end |
| 251 | 251 | ||
| @@ -254,7 +254,7 @@ describe ReadingGroupsController do | @@ -254,7 +254,7 @@ describe ReadingGroupsController do | ||
| 254 | post :update, :id => @subject.id, :reading_group => @subject_params | 254 | post :update, :id => @subject.id, :reading_group => @subject_params |
| 255 | end | 255 | end |
| 256 | 256 | ||
| 257 | - it { should redirect_to reading_group_path } | 257 | + it { is_expected.to redirect_to reading_group_path } |
| 258 | end | 258 | end |
| 259 | end | 259 | end |
| 260 | 260 | ||
| @@ -263,7 +263,7 @@ describe ReadingGroupsController do | @@ -263,7 +263,7 @@ describe ReadingGroupsController do | ||
| 263 | post :update, :id => @subject.id, :reading_group => @subject_params | 263 | post :update, :id => @subject.id, :reading_group => @subject_params |
| 264 | end | 264 | end |
| 265 | 265 | ||
| 266 | - it { should redirect_to new_user_session_path } | 266 | + it { is_expected.to redirect_to new_user_session_path } |
| 267 | end | 267 | end |
| 268 | end | 268 | end |
| 269 | end | 269 | end |
spec/controllers/readings_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ReadingsController do | 3 | +describe ReadingsController, :type => :controller do |
| 4 | let(:reading_group) { FactoryGirl.build(:reading_group) } | 4 | let(:reading_group) { FactoryGirl.build(:reading_group) } |
| 5 | 5 | ||
| 6 | describe 'new' do | 6 | describe 'new' do |
| @@ -14,8 +14,8 @@ describe ReadingsController do | @@ -14,8 +14,8 @@ describe ReadingsController do | ||
| 14 | get :new, reading_group_id: reading_group.id | 14 | get :new, reading_group_id: reading_group.id |
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | - it { should respond_with(:success) } | ||
| 18 | - it { should render_template(:new) } | 17 | + it { is_expected.to respond_with(:success) } |
| 18 | + it { is_expected.to render_template(:new) } | ||
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | context "when the current user doesn't owns the reading group" do | 21 | context "when the current user doesn't owns the reading group" do |
| @@ -23,8 +23,8 @@ describe ReadingsController do | @@ -23,8 +23,8 @@ describe ReadingsController do | ||
| 23 | get :new, reading_group_id: reading_group.id | 23 | get :new, reading_group_id: reading_group.id |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | - it { should redirect_to(reading_group_url(reading_group.id)) } | ||
| 27 | - it { should respond_with(:redirect) } | 26 | + it { is_expected.to redirect_to(reading_group_url(reading_group.id)) } |
| 27 | + it { is_expected.to respond_with(:redirect) } | ||
| 28 | end | 28 | end |
| 29 | end | 29 | end |
| 30 | 30 | ||
| @@ -48,7 +48,7 @@ describe ReadingsController do | @@ -48,7 +48,7 @@ describe ReadingsController do | ||
| 48 | post :create, reading_group_id: reading_group.id, reading: reading_params | 48 | post :create, reading_group_id: reading_group.id, reading: reading_params |
| 49 | end | 49 | end |
| 50 | 50 | ||
| 51 | - it { should respond_with(:redirect) } | 51 | + it { is_expected.to respond_with(:redirect) } |
| 52 | end | 52 | end |
| 53 | 53 | ||
| 54 | context 'with invalid fields' do | 54 | context 'with invalid fields' do |
| @@ -58,7 +58,7 @@ describe ReadingsController do | @@ -58,7 +58,7 @@ describe ReadingsController do | ||
| 58 | post :create, reading_group_id: reading_group.id, reading: reading_params | 58 | post :create, reading_group_id: reading_group.id, reading: reading_params |
| 59 | end | 59 | end |
| 60 | 60 | ||
| 61 | - it { should render_template(:new) } | 61 | + it { is_expected.to render_template(:new) } |
| 62 | end | 62 | end |
| 63 | end | 63 | end |
| 64 | end | 64 | end |
| @@ -78,7 +78,7 @@ describe ReadingsController do | @@ -78,7 +78,7 @@ describe ReadingsController do | ||
| 78 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s | 78 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s |
| 79 | end | 79 | end |
| 80 | 80 | ||
| 81 | - it { should render_template(:edit) } | 81 | + it { is_expected.to render_template(:edit) } |
| 82 | end | 82 | end |
| 83 | 83 | ||
| 84 | context 'when the user does not own the reading' do | 84 | context 'when the user does not own the reading' do |
| @@ -86,9 +86,9 @@ describe ReadingsController do | @@ -86,9 +86,9 @@ describe ReadingsController do | ||
| 86 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s | 86 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s |
| 87 | end | 87 | end |
| 88 | 88 | ||
| 89 | - it { should redirect_to(reading_group_url(reading_group.id)) } | ||
| 90 | - it { should respond_with(:redirect) } | ||
| 91 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 89 | + it { is_expected.to redirect_to(reading_group_url(reading_group.id)) } |
| 90 | + it { is_expected.to respond_with(:redirect) } | ||
| 91 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 92 | end | 92 | end |
| 93 | end | 93 | end |
| 94 | 94 | ||
| @@ -97,7 +97,7 @@ describe ReadingsController do | @@ -97,7 +97,7 @@ describe ReadingsController do | ||
| 97 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s | 97 | get :edit, id: reading.id, reading_group_id: reading_group.id.to_s |
| 98 | end | 98 | end |
| 99 | 99 | ||
| 100 | - it { should redirect_to new_user_session_path } | 100 | + it { is_expected.to redirect_to new_user_session_path } |
| 101 | end | 101 | end |
| 102 | end | 102 | end |
| 103 | 103 | ||
| @@ -123,8 +123,8 @@ describe ReadingsController do | @@ -123,8 +123,8 @@ describe ReadingsController do | ||
| 123 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params | 123 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params |
| 124 | end | 124 | end |
| 125 | 125 | ||
| 126 | - it { should redirect_to(reading_group_path(reading_group.id)) } | ||
| 127 | - it { should respond_with(:redirect) } | 126 | + it { is_expected.to redirect_to(reading_group_path(reading_group.id)) } |
| 127 | + it { is_expected.to respond_with(:redirect) } | ||
| 128 | end | 128 | end |
| 129 | 129 | ||
| 130 | context 'with an invalid field' do | 130 | context 'with an invalid field' do |
| @@ -135,7 +135,7 @@ describe ReadingsController do | @@ -135,7 +135,7 @@ describe ReadingsController do | ||
| 135 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params | 135 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params |
| 136 | end | 136 | end |
| 137 | 137 | ||
| 138 | - it { should render_template(:edit) } | 138 | + it { is_expected.to render_template(:edit) } |
| 139 | end | 139 | end |
| 140 | end | 140 | end |
| 141 | 141 | ||
| @@ -144,7 +144,7 @@ describe ReadingsController do | @@ -144,7 +144,7 @@ describe ReadingsController do | ||
| 144 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params | 144 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params |
| 145 | end | 145 | end |
| 146 | 146 | ||
| 147 | - it { should redirect_to reading_group_path(reading_group.id) } | 147 | + it { is_expected.to redirect_to reading_group_path(reading_group.id) } |
| 148 | end | 148 | end |
| 149 | end | 149 | end |
| 150 | 150 | ||
| @@ -153,7 +153,7 @@ describe ReadingsController do | @@ -153,7 +153,7 @@ describe ReadingsController do | ||
| 153 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params | 153 | post :update, reading_group_id: reading_group.id, id: reading.id, reading: reading_params |
| 154 | end | 154 | end |
| 155 | 155 | ||
| 156 | - it { should redirect_to new_user_session_path } | 156 | + it { is_expected.to redirect_to new_user_session_path } |
| 157 | end | 157 | end |
| 158 | end | 158 | end |
| 159 | 159 | ||
| @@ -174,8 +174,8 @@ describe ReadingsController do | @@ -174,8 +174,8 @@ describe ReadingsController do | ||
| 174 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s | 174 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s |
| 175 | end | 175 | end |
| 176 | 176 | ||
| 177 | - it { should redirect_to(reading_group_path(reading.group_id)) } | ||
| 178 | - it { should respond_with(:redirect) } | 177 | + it { is_expected.to redirect_to(reading_group_path(reading.group_id)) } |
| 178 | + it { is_expected.to respond_with(:redirect) } | ||
| 179 | end | 179 | end |
| 180 | 180 | ||
| 181 | context "when the user doesn't own the reading group" do | 181 | context "when the user doesn't own the reading group" do |
| @@ -183,8 +183,8 @@ describe ReadingsController do | @@ -183,8 +183,8 @@ describe ReadingsController do | ||
| 183 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s | 183 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s |
| 184 | end | 184 | end |
| 185 | 185 | ||
| 186 | - it { should redirect_to(reading_group_path(reading.group_id)) } | ||
| 187 | - it { should respond_with(:redirect) } | 186 | + it { is_expected.to redirect_to(reading_group_path(reading.group_id)) } |
| 187 | + it { is_expected.to respond_with(:redirect) } | ||
| 188 | end | 188 | end |
| 189 | end | 189 | end |
| 190 | 190 | ||
| @@ -193,7 +193,7 @@ describe ReadingsController do | @@ -193,7 +193,7 @@ describe ReadingsController do | ||
| 193 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s | 193 | delete :destroy, id: reading.id, reading_group_id: reading.group_id.to_s |
| 194 | end | 194 | end |
| 195 | 195 | ||
| 196 | - it { should redirect_to new_user_session_path } | 196 | + it { is_expected.to redirect_to new_user_session_path } |
| 197 | end | 197 | end |
| 198 | end | 198 | end |
| 199 | 199 |
spec/controllers/repositories_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe RepositoriesController do | 3 | +describe RepositoriesController, :type => :controller do |
| 4 | let(:project) { FactoryGirl.build(:project) } | 4 | let(:project) { FactoryGirl.build(:project) } |
| 5 | 5 | ||
| 6 | describe 'new' do | 6 | describe 'new' do |
| @@ -16,8 +16,8 @@ describe RepositoriesController do | @@ -16,8 +16,8 @@ describe RepositoriesController do | ||
| 16 | get :new, project_id: project.id.to_s | 16 | get :new, project_id: project.id.to_s |
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | - it { should respond_with(:success) } | ||
| 20 | - it { should render_template(:new) } | 19 | + it { is_expected.to respond_with(:success) } |
| 20 | + it { is_expected.to render_template(:new) } | ||
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | context "when the current user doesn't owns the project" do | 23 | context "when the current user doesn't owns the project" do |
| @@ -25,8 +25,8 @@ describe RepositoriesController do | @@ -25,8 +25,8 @@ describe RepositoriesController do | ||
| 25 | get :new, project_id: project.id.to_s | 25 | get :new, project_id: project.id.to_s |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | - it { should redirect_to(projects_url) } | ||
| 29 | - it { should respond_with(:redirect) } | 28 | + it { is_expected.to redirect_to(projects_url) } |
| 29 | + it { is_expected.to respond_with(:redirect) } | ||
| 30 | end | 30 | end |
| 31 | end | 31 | end |
| 32 | 32 | ||
| @@ -50,8 +50,8 @@ describe RepositoriesController do | @@ -50,8 +50,8 @@ describe RepositoriesController do | ||
| 50 | post :create, project_id: project.id, repository: repository_params | 50 | post :create, project_id: project.id, repository: repository_params |
| 51 | end | 51 | end |
| 52 | 52 | ||
| 53 | - it { should redirect_to(project_repository_process_path(repository.project_id, repository.id)) } | ||
| 54 | - it { should respond_with(:redirect) } | 53 | + it { is_expected.to redirect_to(project_repository_process_path(repository.project_id, repository.id)) } |
| 54 | + it { is_expected.to respond_with(:redirect) } | ||
| 55 | end | 55 | end |
| 56 | 56 | ||
| 57 | context 'with an invalid field' do | 57 | context 'with an invalid field' do |
| @@ -62,7 +62,7 @@ describe RepositoriesController do | @@ -62,7 +62,7 @@ describe RepositoriesController do | ||
| 62 | post :create, project_id: project.id.to_s, repository: repository_params | 62 | post :create, project_id: project.id.to_s, repository: repository_params |
| 63 | end | 63 | end |
| 64 | 64 | ||
| 65 | - it { should render_template(:new) } | 65 | + it { is_expected.to render_template(:new) } |
| 66 | end | 66 | end |
| 67 | end | 67 | end |
| 68 | 68 | ||
| @@ -71,8 +71,8 @@ describe RepositoriesController do | @@ -71,8 +71,8 @@ describe RepositoriesController do | ||
| 71 | post :create, project_id: project.id, repository: repository_params | 71 | post :create, project_id: project.id, repository: repository_params |
| 72 | end | 72 | end |
| 73 | 73 | ||
| 74 | - it { should redirect_to(projects_url) } | ||
| 75 | - it { should respond_with(:redirect) } | 74 | + it { is_expected.to redirect_to(projects_url) } |
| 75 | + it { is_expected.to respond_with(:redirect) } | ||
| 76 | end | 76 | end |
| 77 | end | 77 | end |
| 78 | 78 | ||
| @@ -89,7 +89,7 @@ describe RepositoriesController do | @@ -89,7 +89,7 @@ describe RepositoriesController do | ||
| 89 | get :show, id: repository.id.to_s, project_id: project.id.to_s | 89 | get :show, id: repository.id.to_s, project_id: project.id.to_s |
| 90 | end | 90 | end |
| 91 | 91 | ||
| 92 | - it { should render_template(:show) } | 92 | + it { is_expected.to render_template(:show) } |
| 93 | end | 93 | end |
| 94 | 94 | ||
| 95 | context 'for an specific module_result' do | 95 | context 'for an specific module_result' do |
| @@ -103,7 +103,7 @@ describe RepositoriesController do | @@ -103,7 +103,7 @@ describe RepositoriesController do | ||
| 103 | get :show, id: repository.id.to_s, project_id: project.id.to_s | 103 | get :show, id: repository.id.to_s, project_id: project.id.to_s |
| 104 | end | 104 | end |
| 105 | 105 | ||
| 106 | - it { should render_template(:show) } | 106 | + it { is_expected.to render_template(:show) } |
| 107 | end | 107 | end |
| 108 | end | 108 | end |
| 109 | 109 | ||
| @@ -124,8 +124,8 @@ describe RepositoriesController do | @@ -124,8 +124,8 @@ describe RepositoriesController do | ||
| 124 | delete :destroy, id: repository.id, project_id: project.id.to_s | 124 | delete :destroy, id: repository.id, project_id: project.id.to_s |
| 125 | end | 125 | end |
| 126 | 126 | ||
| 127 | - it { should redirect_to(project_path(repository.project_id)) } | ||
| 128 | - it { should respond_with(:redirect) } | 127 | + it { is_expected.to redirect_to(project_path(repository.project_id)) } |
| 128 | + it { is_expected.to respond_with(:redirect) } | ||
| 129 | end | 129 | end |
| 130 | 130 | ||
| 131 | context "when the user doesn't own the project" do | 131 | context "when the user doesn't own the project" do |
| @@ -133,8 +133,8 @@ describe RepositoriesController do | @@ -133,8 +133,8 @@ describe RepositoriesController do | ||
| 133 | delete :destroy, id: repository.id, project_id: project.id.to_s | 133 | delete :destroy, id: repository.id, project_id: project.id.to_s |
| 134 | end | 134 | end |
| 135 | 135 | ||
| 136 | - it { should redirect_to(projects_url) } | ||
| 137 | - it { should respond_with(:redirect) } | 136 | + it { is_expected.to redirect_to(projects_url) } |
| 137 | + it { is_expected.to respond_with(:redirect) } | ||
| 138 | end | 138 | end |
| 139 | end | 139 | end |
| 140 | 140 | ||
| @@ -143,7 +143,7 @@ describe RepositoriesController do | @@ -143,7 +143,7 @@ describe RepositoriesController do | ||
| 143 | delete :destroy, id: repository.id, project_id: project.id.to_s | 143 | delete :destroy, id: repository.id, project_id: project.id.to_s |
| 144 | end | 144 | end |
| 145 | 145 | ||
| 146 | - it { should redirect_to new_user_session_path } | 146 | + it { is_expected.to redirect_to new_user_session_path } |
| 147 | end | 147 | end |
| 148 | end | 148 | end |
| 149 | 149 | ||
| @@ -163,7 +163,7 @@ describe RepositoriesController do | @@ -163,7 +163,7 @@ describe RepositoriesController do | ||
| 163 | get :edit, id: repository.id, project_id: project.id.to_s | 163 | get :edit, id: repository.id, project_id: project.id.to_s |
| 164 | end | 164 | end |
| 165 | 165 | ||
| 166 | - it { should render_template(:edit) } | 166 | + it { is_expected.to render_template(:edit) } |
| 167 | end | 167 | end |
| 168 | 168 | ||
| 169 | context 'when the user does not own the repository' do | 169 | context 'when the user does not own the repository' do |
| @@ -171,9 +171,9 @@ describe RepositoriesController do | @@ -171,9 +171,9 @@ describe RepositoriesController do | ||
| 171 | get :edit, id: repository.id, project_id: project.id.to_s | 171 | get :edit, id: repository.id, project_id: project.id.to_s |
| 172 | end | 172 | end |
| 173 | 173 | ||
| 174 | - it { should redirect_to(projects_url) } | ||
| 175 | - it { should respond_with(:redirect) } | ||
| 176 | - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } | 174 | + it { is_expected.to redirect_to(projects_url) } |
| 175 | + it { is_expected.to respond_with(:redirect) } | ||
| 176 | + it { is_expected.to set_the_flash[:notice].to("You're not allowed to do this operation") } | ||
| 177 | end | 177 | end |
| 178 | end | 178 | end |
| 179 | 179 | ||
| @@ -182,7 +182,7 @@ describe RepositoriesController do | @@ -182,7 +182,7 @@ describe RepositoriesController do | ||
| 182 | get :edit, id: repository.id, project_id: project.id.to_s | 182 | get :edit, id: repository.id, project_id: project.id.to_s |
| 183 | end | 183 | end |
| 184 | 184 | ||
| 185 | - it { should redirect_to new_user_session_path } | 185 | + it { is_expected.to redirect_to new_user_session_path } |
| 186 | end | 186 | end |
| 187 | end | 187 | end |
| 188 | 188 | ||
| @@ -208,8 +208,8 @@ describe RepositoriesController do | @@ -208,8 +208,8 @@ describe RepositoriesController do | ||
| 208 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params | 208 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params |
| 209 | end | 209 | end |
| 210 | 210 | ||
| 211 | - it { should redirect_to(project_repository_path(repository.project_id, repository.id)) } | ||
| 212 | - it { should respond_with(:redirect) } | 211 | + it { is_expected.to redirect_to(project_repository_path(repository.project_id, repository.id)) } |
| 212 | + it { is_expected.to respond_with(:redirect) } | ||
| 213 | end | 213 | end |
| 214 | 214 | ||
| 215 | context 'with an invalid field' do | 215 | context 'with an invalid field' do |
| @@ -221,7 +221,7 @@ describe RepositoriesController do | @@ -221,7 +221,7 @@ describe RepositoriesController do | ||
| 221 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params | 221 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params |
| 222 | end | 222 | end |
| 223 | 223 | ||
| 224 | - it { should render_template(:edit) } | 224 | + it { is_expected.to render_template(:edit) } |
| 225 | end | 225 | end |
| 226 | end | 226 | end |
| 227 | 227 | ||
| @@ -230,7 +230,7 @@ describe RepositoriesController do | @@ -230,7 +230,7 @@ describe RepositoriesController do | ||
| 230 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params | 230 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params |
| 231 | end | 231 | end |
| 232 | 232 | ||
| 233 | - it { should redirect_to projects_path } | 233 | + it { is_expected.to redirect_to projects_path } |
| 234 | end | 234 | end |
| 235 | end | 235 | end |
| 236 | 236 | ||
| @@ -239,7 +239,7 @@ describe RepositoriesController do | @@ -239,7 +239,7 @@ describe RepositoriesController do | ||
| 239 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params | 239 | post :update, project_id: project.id.to_s, id: repository.id, repository: repository_params |
| 240 | end | 240 | end |
| 241 | 241 | ||
| 242 | - it { should redirect_to new_user_session_path } | 242 | + it { is_expected.to redirect_to new_user_session_path } |
| 243 | end | 243 | end |
| 244 | end | 244 | end |
| 245 | 245 | ||
| @@ -254,8 +254,8 @@ describe RepositoriesController do | @@ -254,8 +254,8 @@ describe RepositoriesController do | ||
| 254 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: ''} | 254 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: ''} |
| 255 | end | 255 | end |
| 256 | 256 | ||
| 257 | - it { should respond_with(:success) } | ||
| 258 | - it { should render_template(:unprocessed) } | 257 | + it { is_expected.to respond_with(:success) } |
| 258 | + it { is_expected.to render_template(:unprocessed) } | ||
| 259 | end | 259 | end |
| 260 | 260 | ||
| 261 | context 'with a READY state' do | 261 | context 'with a READY state' do |
| @@ -268,8 +268,8 @@ describe RepositoriesController do | @@ -268,8 +268,8 @@ describe RepositoriesController do | ||
| 268 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'ANALYZING'} | 268 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'ANALYZING'} |
| 269 | end | 269 | end |
| 270 | 270 | ||
| 271 | - it { should respond_with(:success) } | ||
| 272 | - it { should render_template(:load_ready_processing) } | 271 | + it { is_expected.to respond_with(:success) } |
| 272 | + it { is_expected.to render_template(:load_ready_processing) } | ||
| 273 | end | 273 | end |
| 274 | 274 | ||
| 275 | context 'with another state then READY' do | 275 | context 'with another state then READY' do |
| @@ -282,8 +282,8 @@ describe RepositoriesController do | @@ -282,8 +282,8 @@ describe RepositoriesController do | ||
| 282 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'LOADING'} | 282 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'LOADING'} |
| 283 | end | 283 | end |
| 284 | 284 | ||
| 285 | - it { should respond_with(:success) } | ||
| 286 | - it { should render_template(:reload_processing) } | 285 | + it { is_expected.to respond_with(:success) } |
| 286 | + it { is_expected.to render_template(:reload_processing) } | ||
| 287 | end | 287 | end |
| 288 | 288 | ||
| 289 | context 'when it was already READY' do | 289 | context 'when it was already READY' do |
| @@ -293,8 +293,8 @@ describe RepositoriesController do | @@ -293,8 +293,8 @@ describe RepositoriesController do | ||
| 293 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'READY'} | 293 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: 'READY'} |
| 294 | end | 294 | end |
| 295 | 295 | ||
| 296 | - it { should respond_with(:ok) } | ||
| 297 | - it { should_not render_with_layout } | 296 | + it { is_expected.to respond_with(:ok) } |
| 297 | + it { is_expected.not_to render_with_layout } | ||
| 298 | end | 298 | end |
| 299 | 299 | ||
| 300 | context 'with a given date' do | 300 | context 'with a given date' do |
| @@ -307,8 +307,8 @@ describe RepositoriesController do | @@ -307,8 +307,8 @@ describe RepositoriesController do | ||
| 307 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: '', day: '11', month: '11', year: '2013'} | 307 | xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: '', day: '11', month: '11', year: '2013'} |
| 308 | end | 308 | end |
| 309 | 309 | ||
| 310 | - it { should respond_with(:ok) } | ||
| 311 | - it { should_not render_with_layout } | 310 | + it { is_expected.to respond_with(:ok) } |
| 311 | + it { is_expected.not_to render_with_layout } | ||
| 312 | end | 312 | end |
| 313 | end | 313 | end |
| 314 | 314 | ||
| @@ -322,6 +322,6 @@ describe RepositoriesController do | @@ -322,6 +322,6 @@ describe RepositoriesController do | ||
| 322 | MezuroConfiguration.expects(:find).with(repository.id).returns(FactoryGirl.build(:mezuro_configuration)) | 322 | MezuroConfiguration.expects(:find).with(repository.id).returns(FactoryGirl.build(:mezuro_configuration)) |
| 323 | get :process_repository, project_id: project.id.to_s, id: repository.id | 323 | get :process_repository, project_id: project.id.to_s, id: repository.id |
| 324 | end | 324 | end |
| 325 | - it { should redirect_to(project_repository_path(repository.project_id, repository.id)) } | 325 | + it { is_expected.to redirect_to(project_repository_path(repository.project_id, repository.id)) } |
| 326 | end | 326 | end |
| 327 | end | 327 | end |
spec/controllers/users_controller_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe UsersController do | 3 | +describe UsersController, :type => :controller do |
| 4 | describe 'projects' do | 4 | describe 'projects' do |
| 5 | let(:user) { FactoryGirl.build(:user) } | 5 | let(:user) { FactoryGirl.build(:user) } |
| 6 | 6 | ||
| @@ -10,6 +10,6 @@ describe UsersController do | @@ -10,6 +10,6 @@ describe UsersController do | ||
| 10 | get :projects, user_id: user.id | 10 | get :projects, user_id: user.id |
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | - it { should render_template(:projects) } | 13 | + it { is_expected.to render_template(:projects) } |
| 14 | end | 14 | end |
| 15 | end | 15 | end |
spec/helpers/compound_metric_configurations_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe CompoundMetricConfigurationsHelper do | 3 | +describe CompoundMetricConfigurationsHelper, :type => :helper do |
| 4 | describe 'scope_options' do | 4 | describe 'scope_options' do |
| 5 | it 'should return an array with the supported scope options' do | 5 | it 'should return an array with the supported scope options' do |
| 6 | - helper.scope_options.should eq [["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"]] | 6 | + expect(helper.scope_options).to eq [["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"]] |
| 7 | end | 7 | end |
| 8 | end | 8 | end |
| 9 | end | 9 | end |
spec/helpers/metric_configurations_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MetricConfigurationsHelper do | 3 | +describe MetricConfigurationsHelper, :type => :helper do |
| 4 | describe 'aggregation_form_options' do | 4 | describe 'aggregation_form_options' do |
| 5 | it 'should return an array with the supported aggregation forms' do | 5 | it 'should return an array with the supported aggregation forms' do |
| 6 | - helper.aggregation_options.should eq [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], | 6 | + expect(helper.aggregation_options).to eq [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], |
| 7 | ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] | 7 | ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] |
| 8 | end | 8 | end |
| 9 | end | 9 | end |
| @@ -16,7 +16,7 @@ describe MetricConfigurationsHelper do | @@ -16,7 +16,7 @@ describe MetricConfigurationsHelper do | ||
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | it 'should return a pair with the reading group name and id' do | 18 | it 'should return a pair with the reading group name and id' do |
| 19 | - helper.reading_group_options.should eq [[reading_group.name, reading_group.id]] | 19 | + expect(helper.reading_group_options).to eq [[reading_group.name, reading_group.id]] |
| 20 | end | 20 | end |
| 21 | end | 21 | end |
| 22 | 22 | ||
| @@ -28,7 +28,7 @@ describe MetricConfigurationsHelper do | @@ -28,7 +28,7 @@ describe MetricConfigurationsHelper do | ||
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | it 'should return a pair with the metric configuration code and metric name' do | 30 | it 'should return a pair with the metric configuration code and metric name' do |
| 31 | - helper.native_metrics_of(metric_configuration.configuration_id).should eq [[metric_configuration.code, metric_configuration.metric.name]] | 31 | + expect(helper.native_metrics_of(metric_configuration.configuration_id)).to eq [[metric_configuration.code, metric_configuration.metric.name]] |
| 32 | end | 32 | end |
| 33 | end | 33 | end |
| 34 | end | 34 | end |
spec/helpers/mezuro_configurations_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroConfigurationsHelper do | 3 | +describe MezuroConfigurationsHelper, :type => :helper do |
| 4 | describe 'mezuro_configuration_owner?' do | 4 | describe 'mezuro_configuration_owner?' do |
| 5 | before :each do | 5 | before :each do |
| 6 | @subject = FactoryGirl.build(:mezuro_configuration) | 6 | @subject = FactoryGirl.build(:mezuro_configuration) |
| @@ -10,7 +10,7 @@ describe MezuroConfigurationsHelper do | @@ -10,7 +10,7 @@ describe MezuroConfigurationsHelper do | ||
| 10 | before :each do | 10 | before :each do |
| 11 | helper.expects(:user_signed_in?).returns(false) | 11 | helper.expects(:user_signed_in?).returns(false) |
| 12 | end | 12 | end |
| 13 | - it { helper.mezuro_configuration_owner?(@subject.id).should be_false } | 13 | + it { expect(helper.mezuro_configuration_owner?(@subject.id)).to be_falsey } |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | context 'returns false if is not the owner' do | 16 | context 'returns false if is not the owner' do |
| @@ -24,7 +24,7 @@ describe MezuroConfigurationsHelper do | @@ -24,7 +24,7 @@ describe MezuroConfigurationsHelper do | ||
| 24 | User.any_instance.expects(:mezuro_configuration_ownerships).returns(@ownerships) | 24 | User.any_instance.expects(:mezuro_configuration_ownerships).returns(@ownerships) |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | - it { helper.mezuro_configuration_owner?(@subject.id).should be_false } | 27 | + it { expect(helper.mezuro_configuration_owner?(@subject.id)).to be_falsey } |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | context 'returns true if user is the mezuro_configuration owner' do | 30 | context 'returns true if user is the mezuro_configuration owner' do |
| @@ -38,7 +38,7 @@ describe MezuroConfigurationsHelper do | @@ -38,7 +38,7 @@ describe MezuroConfigurationsHelper do | ||
| 38 | User.any_instance.expects(:mezuro_configuration_ownerships).returns(@ownerships) | 38 | User.any_instance.expects(:mezuro_configuration_ownerships).returns(@ownerships) |
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | - it { helper.mezuro_configuration_owner?(@subject.id).should be_true } | 41 | + it { expect(helper.mezuro_configuration_owner?(@subject.id)).to be_truthy } |
| 42 | end | 42 | end |
| 43 | end | 43 | end |
| 44 | 44 | ||
| @@ -47,14 +47,14 @@ describe MezuroConfigurationsHelper do | @@ -47,14 +47,14 @@ describe MezuroConfigurationsHelper do | ||
| 47 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } | 47 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } |
| 48 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{metric_configuration.configuration_id}/metric_configurations/#{metric_configuration.id}/edit\">Edit</a>"} | 48 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{metric_configuration.configuration_id}/metric_configurations/#{metric_configuration.id}/edit\">Edit</a>"} |
| 49 | 49 | ||
| 50 | - it { helper.link_to_edit_form(metric_configuration, metric_configuration.configuration_id).should eq(response_link) } | 50 | + it { expect(helper.link_to_edit_form(metric_configuration, metric_configuration.configuration_id)).to eq(response_link) } |
| 51 | end | 51 | end |
| 52 | 52 | ||
| 53 | context 'when the metric is compound' do | 53 | context 'when the metric is compound' do |
| 54 | let(:compound_metric_configuration) { FactoryGirl.build(:compound_metric_configuration) } | 54 | let(:compound_metric_configuration) { FactoryGirl.build(:compound_metric_configuration) } |
| 55 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{compound_metric_configuration.configuration_id}/compound_metric_configurations/#{compound_metric_configuration.id}/edit\">Edit</a>"} | 55 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{compound_metric_configuration.configuration_id}/compound_metric_configurations/#{compound_metric_configuration.id}/edit\">Edit</a>"} |
| 56 | 56 | ||
| 57 | - it { helper.link_to_edit_form(compound_metric_configuration, compound_metric_configuration.configuration_id).should eq(response_link) } | 57 | + it { expect(helper.link_to_edit_form(compound_metric_configuration, compound_metric_configuration.configuration_id)).to eq(response_link) } |
| 58 | end | 58 | end |
| 59 | end | 59 | end |
| 60 | 60 | ||
| @@ -63,14 +63,14 @@ describe MezuroConfigurationsHelper do | @@ -63,14 +63,14 @@ describe MezuroConfigurationsHelper do | ||
| 63 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } | 63 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } |
| 64 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{metric_configuration.configuration_id}/metric_configurations/#{metric_configuration.id}\">Show</a>"} | 64 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{metric_configuration.configuration_id}/metric_configurations/#{metric_configuration.id}\">Show</a>"} |
| 65 | 65 | ||
| 66 | - it { helper.link_to_show_page(metric_configuration, metric_configuration.configuration_id).should eq(response_link) } | 66 | + it { expect(helper.link_to_show_page(metric_configuration, metric_configuration.configuration_id)).to eq(response_link) } |
| 67 | end | 67 | end |
| 68 | 68 | ||
| 69 | context 'when the metric is compound' do | 69 | context 'when the metric is compound' do |
| 70 | let(:compound_metric_configuration) { FactoryGirl.build(:compound_metric_configuration) } | 70 | let(:compound_metric_configuration) { FactoryGirl.build(:compound_metric_configuration) } |
| 71 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{compound_metric_configuration.configuration_id}/compound_metric_configurations/#{compound_metric_configuration.id}\">Show</a>"} | 71 | let(:response_link) {"<a class=\"btn btn-info\" href=\"/mezuro_configurations/#{compound_metric_configuration.configuration_id}/compound_metric_configurations/#{compound_metric_configuration.id}\">Show</a>"} |
| 72 | 72 | ||
| 73 | - it { helper.link_to_show_page(compound_metric_configuration, compound_metric_configuration.configuration_id).should eq(response_link) } | 73 | + it { expect(helper.link_to_show_page(compound_metric_configuration, compound_metric_configuration.configuration_id)).to eq(response_link) } |
| 74 | end | 74 | end |
| 75 | end | 75 | end |
| 76 | end | 76 | end |
spec/helpers/mezuro_ranges_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroRangesHelper do | 3 | +describe MezuroRangesHelper, :type => :helper do |
| 4 | describe 'readings_options' do | 4 | describe 'readings_options' do |
| 5 | let(:reading) { FactoryGirl.build(:reading) } | 5 | let(:reading) { FactoryGirl.build(:reading) } |
| 6 | it 'should return a pair with the reading label and id' do | 6 | it 'should return a pair with the reading label and id' do |
| 7 | - helper.readings_options([reading]).should eq [[reading.label, reading.id]] | 7 | + expect(helper.readings_options([reading])).to eq [[reading.label, reading.id]] |
| 8 | end | 8 | end |
| 9 | end | 9 | end |
| 10 | end | 10 | end |
spec/helpers/processings_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ProcessingsHelper do | 3 | +describe ProcessingsHelper, :type => :helper do |
| 4 | describe 'humanize_eplased_time' do | 4 | describe 'humanize_eplased_time' do |
| 5 | it 'should convert it to readable words' do | 5 | it 'should convert it to readable words' do |
| 6 | - helper.humanize_eplased_time(6000).should eq('less than a minute') | 6 | + expect(helper.humanize_eplased_time(6000)).to eq('less than a minute') |
| 7 | end | 7 | end |
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | describe 'format_grade' do | 10 | describe 'format_grade' do |
| 11 | it 'should format a Float to a readable format' do | 11 | it 'should format a Float to a readable format' do |
| 12 | - helper.format_grade(1.333333333).should eq("1.33") | 12 | + expect(helper.format_grade(1.333333333)).to eq("1.33") |
| 13 | end | 13 | end |
| 14 | end | 14 | end |
| 15 | 15 | ||
| @@ -28,7 +28,7 @@ describe ProcessingsHelper do | @@ -28,7 +28,7 @@ describe ProcessingsHelper do | ||
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | it 'should return the range snapshot in which the value was in between' do | 30 | it 'should return the range snapshot in which the value was in between' do |
| 31 | - helper.find_range_snapshot(metric_result).should eq(range_snapshot_5dot1_to_10) | 31 | + expect(helper.find_range_snapshot(metric_result)).to eq(range_snapshot_5dot1_to_10) |
| 32 | end | 32 | end |
| 33 | end | 33 | end |
| 34 | 34 | ||
| @@ -37,7 +37,7 @@ describe ProcessingsHelper do | @@ -37,7 +37,7 @@ describe ProcessingsHelper do | ||
| 37 | let(:name) { 'org' } | 37 | let(:name) { 'org' } |
| 38 | 38 | ||
| 39 | it 'should not make any change' do | 39 | it 'should not make any change' do |
| 40 | - helper.format_module_name(name).should eq(name) | 40 | + expect(helper.format_module_name(name)).to eq(name) |
| 41 | end | 41 | end |
| 42 | end | 42 | end |
| 43 | 43 | ||
| @@ -45,7 +45,7 @@ describe ProcessingsHelper do | @@ -45,7 +45,7 @@ describe ProcessingsHelper do | ||
| 45 | let(:name) { ['org', 'mezuro'] } | 45 | let(:name) { ['org', 'mezuro'] } |
| 46 | 46 | ||
| 47 | it "should return it's last element" do | 47 | it "should return it's last element" do |
| 48 | - helper.format_module_name(name).should eq(name.last) | 48 | + expect(helper.format_module_name(name)).to eq(name.last) |
| 49 | end | 49 | end |
| 50 | end | 50 | end |
| 51 | 51 |
spec/helpers/projects_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ProjectsHelper do | 3 | +describe ProjectsHelper, :type => :helper do |
| 4 | 4 | ||
| 5 | describe 'project_owner?' do | 5 | describe 'project_owner?' do |
| 6 | before :each do | 6 | before :each do |
| @@ -11,7 +11,7 @@ describe ProjectsHelper do | @@ -11,7 +11,7 @@ describe ProjectsHelper do | ||
| 11 | before :each do | 11 | before :each do |
| 12 | helper.expects(:user_signed_in?).returns(false) | 12 | helper.expects(:user_signed_in?).returns(false) |
| 13 | end | 13 | end |
| 14 | - it { helper.project_owner?(@subject.id).should be_false } | 14 | + it { expect(helper.project_owner?(@subject.id)).to be_falsey } |
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | context 'returns false if is not the owner' do | 17 | context 'returns false if is not the owner' do |
| @@ -25,7 +25,7 @@ describe ProjectsHelper do | @@ -25,7 +25,7 @@ describe ProjectsHelper do | ||
| 25 | User.any_instance.expects(:project_ownerships).returns(@ownerships) | 25 | User.any_instance.expects(:project_ownerships).returns(@ownerships) |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | - it { helper.project_owner?(@subject.id).should be_false } | 28 | + it { expect(helper.project_owner?(@subject.id)).to be_falsey } |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | context 'returns true if user is the project owner' do | 31 | context 'returns true if user is the project owner' do |
| @@ -39,7 +39,7 @@ describe ProjectsHelper do | @@ -39,7 +39,7 @@ describe ProjectsHelper do | ||
| 39 | User.any_instance.expects(:project_ownerships).returns(@ownerships) | 39 | User.any_instance.expects(:project_ownerships).returns(@ownerships) |
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | - it { helper.project_owner?(@subject.id).should be_true } | 42 | + it { expect(helper.project_owner?(@subject.id)).to be_truthy } |
| 43 | end | 43 | end |
| 44 | end | 44 | end |
| 45 | 45 |
spec/helpers/reading_groups_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ReadingGroupsHelper do | 3 | +describe ReadingGroupsHelper, :type => :helper do |
| 4 | 4 | ||
| 5 | describe 'reading_group_owner?' do | 5 | describe 'reading_group_owner?' do |
| 6 | before :each do | 6 | before :each do |
| @@ -11,7 +11,7 @@ describe ReadingGroupsHelper do | @@ -11,7 +11,7 @@ describe ReadingGroupsHelper do | ||
| 11 | before :each do | 11 | before :each do |
| 12 | helper.expects(:user_signed_in?).returns(false) | 12 | helper.expects(:user_signed_in?).returns(false) |
| 13 | end | 13 | end |
| 14 | - it { helper.reading_groups_owner?(@subject.id).should be_false } | 14 | + it { expect(helper.reading_groups_owner?(@subject.id)).to be_falsey } |
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | context 'returns false if is not the owner' do | 17 | context 'returns false if is not the owner' do |
| @@ -25,7 +25,7 @@ describe ReadingGroupsHelper do | @@ -25,7 +25,7 @@ describe ReadingGroupsHelper do | ||
| 25 | User.any_instance.expects(:reading_group_ownerships).returns(@ownerships) | 25 | User.any_instance.expects(:reading_group_ownerships).returns(@ownerships) |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | - it { helper.reading_groups_owner?(@subject.id).should be_false } | 28 | + it { expect(helper.reading_groups_owner?(@subject.id)).to be_falsey } |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | context 'returns true if user is the reading_group owner' do | 31 | context 'returns true if user is the reading_group owner' do |
| @@ -39,7 +39,7 @@ describe ReadingGroupsHelper do | @@ -39,7 +39,7 @@ describe ReadingGroupsHelper do | ||
| 39 | User.any_instance.expects(:reading_group_ownerships).returns(@ownerships) | 39 | User.any_instance.expects(:reading_group_ownerships).returns(@ownerships) |
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | - it { helper.reading_groups_owner?(@subject.id).should be_true } | 42 | + it { expect(helper.reading_groups_owner?(@subject.id)).to be_truthy } |
| 43 | end | 43 | end |
| 44 | end | 44 | end |
| 45 | 45 |
spec/helpers/repository_helper_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe RepositoryHelper do | 3 | +describe RepositoryHelper, :type => :helper do |
| 4 | 4 | ||
| 5 | describe 'periodicity_options' do | 5 | describe 'periodicity_options' do |
| 6 | it 'should return an array with some sample periods' do | 6 | it 'should return an array with some sample periods' do |
| 7 | - helper.periodicity_options.should eq [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweekly", 15], ["Monthly", 30]] | 7 | + expect(helper.periodicity_options).to eq [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweekly", 15], ["Monthly", 30]] |
| 8 | end | 8 | end |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | describe 'license_options' do | 11 | describe 'license_options' do |
| 12 | it 'should return an array with some sample licenses names' do | 12 | it 'should return an array with some sample licenses names' do |
| 13 | - helper.license_options.should eq YAML.load_file("config/licenses.yml").split("; ") | 13 | + expect(helper.license_options).to eq YAML.load_file("config/licenses.yml").split("; ") |
| 14 | end | 14 | end |
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | describe 'periodicity_option' do | 17 | describe 'periodicity_option' do |
| 18 | it 'should return the periodicity option associated to the given number' do | 18 | it 'should return the periodicity option associated to the given number' do |
| 19 | - helper.periodicity_option(1).should eq "1 day" | 19 | + expect(helper.periodicity_option(1)).to eq "1 day" |
| 20 | end | 20 | end |
| 21 | 21 | ||
| 22 | it 'should return Undefined when there is no periodicity value' do | 22 | it 'should return Undefined when there is no periodicity value' do |
| 23 | - helper.periodicity_option(nil).should eq "Undefined" | 23 | + expect(helper.periodicity_option(nil)).to eq "Undefined" |
| 24 | end | 24 | end |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | describe 'calendar' do | 27 | describe 'calendar' do |
| 28 | it 'should return an array with the number of days' do | 28 | it 'should return an array with the number of days' do |
| 29 | days = (1..31).to_a.map {|day| [day, day]} | 29 | days = (1..31).to_a.map {|day| [day, day]} |
| 30 | - helper.day_options.should eq days | 30 | + expect(helper.day_options).to eq days |
| 31 | end | 31 | end |
| 32 | 32 | ||
| 33 | it 'should return an array with the number of months' do | 33 | it 'should return an array with the number of months' do |
| 34 | months = (1..12).to_a.map {|month| [month, month]} | 34 | months = (1..12).to_a.map {|month| [month, month]} |
| 35 | - helper.month_options.should eq months | 35 | + expect(helper.month_options).to eq months |
| 36 | end | 36 | end |
| 37 | 37 | ||
| 38 | it 'should return a range of years' do | 38 | it 'should return a range of years' do |
| 39 | years = (2013..2020).to_a.map {|year| [year, year]} | 39 | years = (2013..2020).to_a.map {|year| [year, year]} |
| 40 | - helper.year_options.should eq years | 40 | + expect(helper.year_options).to eq years |
| 41 | end | 41 | end |
| 42 | end | 42 | end |
| 43 | 43 |
spec/models/metric_configuration_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MetricConfiguration do | 3 | +describe MetricConfiguration, :type => :model do |
| 4 | subject {FactoryGirl.build(:metric_configuration)} | 4 | subject {FactoryGirl.build(:metric_configuration)} |
| 5 | 5 | ||
| 6 | describe 'methods' do | 6 | describe 'methods' do |
| @@ -11,7 +11,7 @@ describe MetricConfiguration do | @@ -11,7 +11,7 @@ describe MetricConfiguration do | ||
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | it 'should returns a list with its ranges' do | 13 | it 'should returns a list with its ranges' do |
| 14 | - subject.mezuro_ranges.should eq([mezuro_range]) | 14 | + expect(subject.mezuro_ranges).to eq([mezuro_range]) |
| 15 | end | 15 | end |
| 16 | end | 16 | end |
| 17 | end | 17 | end |
| @@ -23,9 +23,9 @@ describe MetricConfiguration do | @@ -23,9 +23,9 @@ describe MetricConfiguration do | ||
| 23 | MetricConfiguration.expects(:metric_configurations_of).at_least_once.returns([]) | 23 | MetricConfiguration.expects(:metric_configurations_of).at_least_once.returns([]) |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | - it { should validate_presence_of(:code) } | ||
| 27 | - it { should validate_presence_of(:weight) } | ||
| 28 | - it { should validate_presence_of(:aggregation_form) } | 26 | + it { is_expected.to validate_presence_of(:code) } |
| 27 | + it { is_expected.to validate_presence_of(:weight) } | ||
| 28 | + it { is_expected.to validate_presence_of(:aggregation_form) } | ||
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | context 'code validations' do | 31 | context 'code validations' do |
spec/models/mezuro_configuration_ownership_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroConfigurationOwnership do | 3 | +describe MezuroConfigurationOwnership, :type => :model do |
| 4 | describe 'associations' do | 4 | describe 'associations' do |
| 5 | - it { should belong_to(:user) } | 5 | + it { is_expected.to belong_to(:user) } |
| 6 | end | 6 | end |
| 7 | 7 | ||
| 8 | describe 'methods' do | 8 | describe 'methods' do |
| @@ -15,7 +15,7 @@ describe MezuroConfigurationOwnership do | @@ -15,7 +15,7 @@ describe MezuroConfigurationOwnership do | ||
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | it 'should return the mezuro_configuration' do | 17 | it 'should return the mezuro_configuration' do |
| 18 | - subject.mezuro_configuration.should eq(mezuro_configuration) | 18 | + expect(subject.mezuro_configuration).to eq(mezuro_configuration) |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
| 21 | end | 21 | end |
spec/models/mezuro_configuration_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroConfiguration do | 3 | +describe MezuroConfiguration, :type => :model do |
| 4 | subject { FactoryGirl.build(:mezuro_configuration) } | 4 | subject { FactoryGirl.build(:mezuro_configuration) } |
| 5 | describe 'methods' do | 5 | describe 'methods' do |
| 6 | describe 'persisted?' do | 6 | describe 'persisted?' do |
| @@ -9,7 +9,7 @@ describe MezuroConfiguration do | @@ -9,7 +9,7 @@ describe MezuroConfiguration do | ||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | it 'should return false' do | 11 | it 'should return false' do |
| 12 | - subject.persisted?.should eq(false) | 12 | + expect(subject.persisted?).to eq(false) |
| 13 | end | 13 | end |
| 14 | end | 14 | end |
| 15 | 15 | ||
| @@ -24,7 +24,7 @@ describe MezuroConfiguration do | @@ -24,7 +24,7 @@ describe MezuroConfiguration do | ||
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | it 'should return true' do | 26 | it 'should return true' do |
| 27 | - subject.update(@subject_params).should eq(true) | 27 | + expect(subject.update(@subject_params)).to eq(true) |
| 28 | end | 28 | end |
| 29 | end | 29 | end |
| 30 | 30 | ||
| @@ -34,7 +34,7 @@ describe MezuroConfiguration do | @@ -34,7 +34,7 @@ describe MezuroConfiguration do | ||
| 34 | end | 34 | end |
| 35 | 35 | ||
| 36 | it 'should return false' do | 36 | it 'should return false' do |
| 37 | - subject.update(@subject_params).should eq(false) | 37 | + expect(subject.update(@subject_params)).to eq(false) |
| 38 | end | 38 | end |
| 39 | end | 39 | end |
| 40 | end | 40 | end |
| @@ -46,7 +46,7 @@ describe MezuroConfiguration do | @@ -46,7 +46,7 @@ describe MezuroConfiguration do | ||
| 46 | it 'should call metric_configurations_of on the Metric Configuration model' do | 46 | it 'should call metric_configurations_of on the Metric Configuration model' do |
| 47 | MetricConfiguration.expects(:metric_configurations_of).with(subject.id).returns([metric_configuration]) | 47 | MetricConfiguration.expects(:metric_configurations_of).with(subject.id).returns([metric_configuration]) |
| 48 | 48 | ||
| 49 | - subject.metric_configurations.should include(metric_configuration) | 49 | + expect(subject.metric_configurations).to include(metric_configuration) |
| 50 | end | 50 | end |
| 51 | end | 51 | end |
| 52 | end | 52 | end |
| @@ -56,7 +56,7 @@ describe MezuroConfiguration do | @@ -56,7 +56,7 @@ describe MezuroConfiguration do | ||
| 56 | before :each do | 56 | before :each do |
| 57 | MezuroConfiguration.expects(:all).at_least_once.returns([]) | 57 | MezuroConfiguration.expects(:all).at_least_once.returns([]) |
| 58 | end | 58 | end |
| 59 | - it { should validate_presence_of(:name) } | 59 | + it { is_expected.to validate_presence_of(:name) } |
| 60 | end | 60 | end |
| 61 | 61 | ||
| 62 | context 'kalibro validations' do | 62 | context 'kalibro validations' do |
spec/models/mezuro_range_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe MezuroRange do | 3 | +describe MezuroRange, :type => :model do |
| 4 | subject { FactoryGirl.build(:mezuro_range, { metric_configuration_id: 42 }) } | 4 | subject { FactoryGirl.build(:mezuro_range, { metric_configuration_id: 42 }) } |
| 5 | describe 'validations' do | 5 | describe 'validations' do |
| 6 | context 'active model validations' do | 6 | context 'active model validations' do |
| @@ -8,36 +8,36 @@ describe MezuroRange do | @@ -8,36 +8,36 @@ describe MezuroRange do | ||
| 8 | MezuroRange.expects(:ranges_of).with(subject.metric_configuration_id).at_least_once.returns([]) | 8 | MezuroRange.expects(:ranges_of).with(subject.metric_configuration_id).at_least_once.returns([]) |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | - it { should validate_presence_of(:beginning) } | ||
| 12 | - it { should validate_presence_of(:end) } | ||
| 13 | - it { should validate_presence_of(:reading_id) } | 11 | + it { is_expected.to validate_presence_of(:beginning) } |
| 12 | + it { is_expected.to validate_presence_of(:end) } | ||
| 13 | + it { is_expected.to validate_presence_of(:reading_id) } | ||
| 14 | 14 | ||
| 15 | context 'beginning and end numericality' do | 15 | context 'beginning and end numericality' do |
| 16 | - it { should validate_presence_of(:beginning) } | ||
| 17 | - it { should validate_presence_of(:end) } | 16 | + it { is_expected.to validate_presence_of(:beginning) } |
| 17 | + it { is_expected.to validate_presence_of(:end) } | ||
| 18 | 18 | ||
| 19 | it 'should allow -INF and INF to beginning' do | 19 | it 'should allow -INF and INF to beginning' do |
| 20 | subject.beginning = '-INF' | 20 | subject.beginning = '-INF' |
| 21 | subject.save | 21 | subject.save |
| 22 | 22 | ||
| 23 | - subject.errors.messages.should be_empty | 23 | + expect(subject.errors.messages).to be_empty |
| 24 | 24 | ||
| 25 | subject.beginning = 'INF' | 25 | subject.beginning = 'INF' |
| 26 | subject.save | 26 | subject.save |
| 27 | 27 | ||
| 28 | - subject.errors.messages.should be_empty | 28 | + expect(subject.errors.messages).to be_empty |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | it 'should allow -INF and INF to end' do | 31 | it 'should allow -INF and INF to end' do |
| 32 | subject.end = '-INF' | 32 | subject.end = '-INF' |
| 33 | subject.save | 33 | subject.save |
| 34 | 34 | ||
| 35 | - subject.errors.messages.should be_empty | 35 | + expect(subject.errors.messages).to be_empty |
| 36 | 36 | ||
| 37 | subject.end = 'INF' | 37 | subject.end = 'INF' |
| 38 | subject.save | 38 | subject.save |
| 39 | 39 | ||
| 40 | - subject.errors.messages.should be_empty | 40 | + expect(subject.errors.messages).to be_empty |
| 41 | end | 41 | end |
| 42 | end | 42 | end |
| 43 | end | 43 | end |
spec/models/module_result_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ModuleResult do | 3 | +describe ModuleResult, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | subject { FactoryGirl.build(:module_result) } | 5 | subject { FactoryGirl.build(:module_result) } |
| 6 | 6 | ||
| @@ -18,7 +18,7 @@ describe ModuleResult do | @@ -18,7 +18,7 @@ describe ModuleResult do | ||
| 18 | end | 18 | end |
| 19 | 19 | ||
| 20 | it 'should return a array of DateModuleResults' do | 20 | it 'should return a array of DateModuleResults' do |
| 21 | - subject.history.first.should be_a(DateModuleResult) | 21 | + expect(subject.history.first).to be_a(DateModuleResult) |
| 22 | end | 22 | end |
| 23 | end | 23 | end |
| 24 | 24 | ||
| @@ -32,7 +32,7 @@ describe ModuleResult do | @@ -32,7 +32,7 @@ describe ModuleResult do | ||
| 32 | end | 32 | end |
| 33 | 33 | ||
| 34 | it 'should return the history for the given metric name' do | 34 | it 'should return the history for the given metric name' do |
| 35 | - subject.metric_history(metric_result.metric_configuration_snapshot.metric.name).should eq({date_module_result.date => metric_result.value}) | 35 | + expect(subject.metric_history(metric_result.metric_configuration_snapshot.metric.name)).to eq({date_module_result.date => metric_result.value}) |
| 36 | end | 36 | end |
| 37 | end | 37 | end |
| 38 | end | 38 | end |
spec/models/processing_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe Processing do | 3 | +describe Processing, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | subject { FactoryGirl.build(:processing) } | 5 | subject { FactoryGirl.build(:processing) } |
| 6 | 6 | ||
| 7 | describe 'ready?' do | 7 | describe 'ready?' do |
| 8 | context 'with a READY processing' do | 8 | context 'with a READY processing' do |
| 9 | it 'should return true' do | 9 | it 'should return true' do |
| 10 | - subject.ready?.should be_true | 10 | + expect(subject.ready?).to be_truthy |
| 11 | end | 11 | end |
| 12 | end | 12 | end |
| 13 | 13 | ||
| @@ -15,7 +15,7 @@ describe Processing do | @@ -15,7 +15,7 @@ describe Processing do | ||
| 15 | subject { FactoryGirl.build(:processing, state: 'COLLECTING') } | 15 | subject { FactoryGirl.build(:processing, state: 'COLLECTING') } |
| 16 | 16 | ||
| 17 | it 'should return false' do | 17 | it 'should return false' do |
| 18 | - subject.ready?.should be_false | 18 | + expect(subject.ready?).to be_falsey |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
| 21 | end | 21 | end |
spec/models/project_ownership_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ProjectOwnership do | 3 | +describe ProjectOwnership, :type => :model do |
| 4 | describe 'associations' do | 4 | describe 'associations' do |
| 5 | - it { should belong_to(:user) } | 5 | + it { is_expected.to belong_to(:user) } |
| 6 | end | 6 | end |
| 7 | 7 | ||
| 8 | describe 'methods' do | 8 | describe 'methods' do |
| @@ -15,7 +15,7 @@ describe ProjectOwnership do | @@ -15,7 +15,7 @@ describe ProjectOwnership do | ||
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | it 'should return the project' do | 17 | it 'should return the project' do |
| 18 | - subject.project.should eq(project) | 18 | + expect(subject.project).to eq(project) |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
| 21 | end | 21 | end |
spec/models/project_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe Project do | 3 | +describe Project, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'persisted?' do | 5 | describe 'persisted?' do |
| 6 | before :each do | 6 | before :each do |
| @@ -9,7 +9,7 @@ describe Project do | @@ -9,7 +9,7 @@ describe Project do | ||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | it 'should return false' do | 11 | it 'should return false' do |
| 12 | - @subject.persisted?.should eq(false) | 12 | + expect(@subject.persisted?).to eq(false) |
| 13 | end | 13 | end |
| 14 | end | 14 | end |
| 15 | 15 | ||
| @@ -22,12 +22,12 @@ describe Project do | @@ -22,12 +22,12 @@ describe Project do | ||
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | it 'should return the two projects ordered' do | 24 | it 'should return the two projects ordered' do |
| 25 | - Project.latest(2).should eq([@kalibro, @qt]) | 25 | + expect(Project.latest(2)).to eq([@kalibro, @qt]) |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | context 'when no parameter is passed' do | 28 | context 'when no parameter is passed' do |
| 29 | it 'should return just the most recent project' do | 29 | it 'should return just the most recent project' do |
| 30 | - Project.latest.should eq([@kalibro]) | 30 | + expect(Project.latest).to eq([@kalibro]) |
| 31 | end | 31 | end |
| 32 | end | 32 | end |
| 33 | end | 33 | end |
| @@ -44,7 +44,7 @@ describe Project do | @@ -44,7 +44,7 @@ describe Project do | ||
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | it 'should return true' do | 46 | it 'should return true' do |
| 47 | - @qt.update(@qt_params).should eq(true) | 47 | + expect(@qt.update(@qt_params)).to eq(true) |
| 48 | end | 48 | end |
| 49 | end | 49 | end |
| 50 | 50 | ||
| @@ -54,7 +54,7 @@ describe Project do | @@ -54,7 +54,7 @@ describe Project do | ||
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | it 'should return false' do | 56 | it 'should return false' do |
| 57 | - @qt.update(@qt_params).should eq(false) | 57 | + expect(@qt.update(@qt_params)).to eq(false) |
| 58 | end | 58 | end |
| 59 | end | 59 | end |
| 60 | end | 60 | end |
| @@ -66,7 +66,7 @@ describe Project do | @@ -66,7 +66,7 @@ describe Project do | ||
| 66 | it 'should call repositories_of on the Repository model' do | 66 | it 'should call repositories_of on the Repository model' do |
| 67 | Repository.expects(:repositories_of).with(subject.id).returns([repository]) | 67 | Repository.expects(:repositories_of).with(subject.id).returns([repository]) |
| 68 | 68 | ||
| 69 | - subject.repositories.should include(repository) | 69 | + expect(subject.repositories).to include(repository) |
| 70 | end | 70 | end |
| 71 | end | 71 | end |
| 72 | end | 72 | end |
| @@ -77,7 +77,7 @@ describe Project do | @@ -77,7 +77,7 @@ describe Project do | ||
| 77 | before :each do | 77 | before :each do |
| 78 | Project.expects(:all).at_least_once.returns([]) | 78 | Project.expects(:all).at_least_once.returns([]) |
| 79 | end | 79 | end |
| 80 | - it { should validate_presence_of(:name) } | 80 | + it { is_expected.to validate_presence_of(:name) } |
| 81 | end | 81 | end |
| 82 | 82 | ||
| 83 | context 'kalibro validations' do | 83 | context 'kalibro validations' do |
spec/models/reading_group_ownership_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ReadingGroupOwnership do | 3 | +describe ReadingGroupOwnership, :type => :model do |
| 4 | describe 'associations' do | 4 | describe 'associations' do |
| 5 | - it { should belong_to(:user) } | 5 | + it { is_expected.to belong_to(:user) } |
| 6 | end | 6 | end |
| 7 | 7 | ||
| 8 | describe 'methods' do | 8 | describe 'methods' do |
| @@ -15,7 +15,7 @@ describe ReadingGroupOwnership do | @@ -15,7 +15,7 @@ describe ReadingGroupOwnership do | ||
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | it 'should return the reading_group' do | 17 | it 'should return the reading_group' do |
| 18 | - subject.reading_group.should eq(reading_group) | 18 | + expect(subject.reading_group).to eq(reading_group) |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
| 21 | end | 21 | end |
spec/models/reading_group_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe ReadingGroup do | 3 | +describe ReadingGroup, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'persisted?' do | 5 | describe 'persisted?' do |
| 6 | before :each do | 6 | before :each do |
| @@ -9,7 +9,7 @@ describe ReadingGroup do | @@ -9,7 +9,7 @@ describe ReadingGroup do | ||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | it 'should return false' do | 11 | it 'should return false' do |
| 12 | - @subject.persisted?.should eq(false) | 12 | + expect(@subject.persisted?).to eq(false) |
| 13 | end | 13 | end |
| 14 | end | 14 | end |
| 15 | 15 | ||
| @@ -25,7 +25,7 @@ describe ReadingGroup do | @@ -25,7 +25,7 @@ describe ReadingGroup do | ||
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | it 'should return true' do | 27 | it 'should return true' do |
| 28 | - @qt.update(@qt_params).should eq(true) | 28 | + expect(@qt.update(@qt_params)).to eq(true) |
| 29 | end | 29 | end |
| 30 | end | 30 | end |
| 31 | 31 | ||
| @@ -35,7 +35,7 @@ describe ReadingGroup do | @@ -35,7 +35,7 @@ describe ReadingGroup do | ||
| 35 | end | 35 | end |
| 36 | 36 | ||
| 37 | it 'should return false' do | 37 | it 'should return false' do |
| 38 | - @qt.update(@qt_params).should eq(false) | 38 | + expect(@qt.update(@qt_params)).to eq(false) |
| 39 | end | 39 | end |
| 40 | end | 40 | end |
| 41 | end | 41 | end |
| @@ -47,7 +47,7 @@ describe ReadingGroup do | @@ -47,7 +47,7 @@ describe ReadingGroup do | ||
| 47 | it 'should call readings_of on the Reading model' do | 47 | it 'should call readings_of on the Reading model' do |
| 48 | Reading.expects(:readings_of).with(subject.id).returns([reading]) | 48 | Reading.expects(:readings_of).with(subject.id).returns([reading]) |
| 49 | 49 | ||
| 50 | - subject.readings.should include(reading) | 50 | + expect(subject.readings).to include(reading) |
| 51 | end | 51 | end |
| 52 | end | 52 | end |
| 53 | end | 53 | end |
| @@ -58,7 +58,7 @@ describe ReadingGroup do | @@ -58,7 +58,7 @@ describe ReadingGroup do | ||
| 58 | before :each do | 58 | before :each do |
| 59 | ReadingGroup.expects(:all).at_least_once.returns([]) | 59 | ReadingGroup.expects(:all).at_least_once.returns([]) |
| 60 | end | 60 | end |
| 61 | - it { should validate_presence_of(:name) } | 61 | + it { is_expected.to validate_presence_of(:name) } |
| 62 | end | 62 | end |
| 63 | 63 | ||
| 64 | context 'kalibro validations' do | 64 | context 'kalibro validations' do |
spec/models/reading_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe Reading do | 3 | +describe Reading, :type => :model do |
| 4 | describe 'validations' do | 4 | describe 'validations' do |
| 5 | subject {FactoryGirl.build(:reading)} | 5 | subject {FactoryGirl.build(:reading)} |
| 6 | 6 | ||
| @@ -9,10 +9,10 @@ describe Reading do | @@ -9,10 +9,10 @@ describe Reading do | ||
| 9 | Reading.expects(:all).at_least_once.returns([]) | 9 | Reading.expects(:all).at_least_once.returns([]) |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | - it { should validate_presence_of(:label) } | ||
| 13 | - it { should validate_presence_of(:color) } | ||
| 14 | - it { should validate_presence_of(:grade) } | ||
| 15 | - it { should validate_numericality_of(:grade) } | 12 | + it { is_expected.to validate_presence_of(:label) } |
| 13 | + it { is_expected.to validate_presence_of(:color) } | ||
| 14 | + it { is_expected.to validate_presence_of(:grade) } | ||
| 15 | + it { is_expected.to validate_numericality_of(:grade) } | ||
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | context 'kalibro validations' do | 18 | context 'kalibro validations' do |
spec/models/repository_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe Repository do | 3 | +describe Repository, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'last_processing' do | 5 | describe 'last_processing' do |
| 6 | subject { FactoryGirl.build(:repository) } | 6 | subject { FactoryGirl.build(:repository) } |
| @@ -11,7 +11,7 @@ describe Repository do | @@ -11,7 +11,7 @@ describe Repository do | ||
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | it 'should return nil' do | 13 | it 'should return nil' do |
| 14 | - subject.last_processing.should be_nil | 14 | + expect(subject.last_processing).to be_nil |
| 15 | end | 15 | end |
| 16 | end | 16 | end |
| 17 | 17 | ||
| @@ -26,7 +26,7 @@ describe Repository do | @@ -26,7 +26,7 @@ describe Repository do | ||
| 26 | it 'should return a ready processing processing' do | 26 | it 'should return a ready processing processing' do |
| 27 | Processing.expects(:last_ready_processing_of).with(subject.id).returns(processing) | 27 | Processing.expects(:last_ready_processing_of).with(subject.id).returns(processing) |
| 28 | 28 | ||
| 29 | - subject.last_processing.should eq(processing) | 29 | + expect(subject.last_processing).to eq(processing) |
| 30 | end | 30 | end |
| 31 | end | 31 | end |
| 32 | 32 | ||
| @@ -41,7 +41,7 @@ describe Repository do | @@ -41,7 +41,7 @@ describe Repository do | ||
| 41 | it 'should return the latest processing' do | 41 | it 'should return the latest processing' do |
| 42 | Processing.expects(:last_processing_of).with(subject.id).returns(processing) | 42 | Processing.expects(:last_processing_of).with(subject.id).returns(processing) |
| 43 | 43 | ||
| 44 | - subject.last_processing.should eq(processing) | 44 | + expect(subject.last_processing).to eq(processing) |
| 45 | end | 45 | end |
| 46 | end | 46 | end |
| 47 | end | 47 | end |
| @@ -55,8 +55,8 @@ describe Repository do | @@ -55,8 +55,8 @@ describe Repository do | ||
| 55 | Repository.expects(:all).at_least_once.returns([]) | 55 | Repository.expects(:all).at_least_once.returns([]) |
| 56 | end | 56 | end |
| 57 | 57 | ||
| 58 | - it { should validate_presence_of(:name) } | ||
| 59 | - it { should validate_presence_of(:address) } | 58 | + it { is_expected.to validate_presence_of(:name) } |
| 59 | + it { is_expected.to validate_presence_of(:address) } | ||
| 60 | end | 60 | end |
| 61 | 61 | ||
| 62 | context 'kalibro validations' do | 62 | context 'kalibro validations' do |
spec/models/user_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe User do | 3 | +describe User, :type => :model do |
| 4 | context 'validations' do | 4 | context 'validations' do |
| 5 | subject { FactoryGirl.build(:user) } | 5 | subject { FactoryGirl.build(:user) } |
| 6 | 6 | ||
| 7 | - it { should validate_presence_of(:name) } | ||
| 8 | - it { should validate_presence_of(:email) } | ||
| 9 | - it { should validate_uniqueness_of(:email) } | 7 | + it { is_expected.to validate_presence_of(:name) } |
| 8 | + it { is_expected.to validate_presence_of(:email) } | ||
| 9 | + it { is_expected.to validate_uniqueness_of(:email) } | ||
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | describe 'associations' do | 12 | describe 'associations' do |
| 13 | - it { should have_many(:project_ownerships) } | ||
| 14 | - it { should have_many(:reading_group_ownerships) } | ||
| 15 | - it { should have_many(:mezuro_configuration_ownerships) } | 13 | + it { is_expected.to have_many(:project_ownerships) } |
| 14 | + it { is_expected.to have_many(:reading_group_ownerships) } | ||
| 15 | + it { is_expected.to have_many(:mezuro_configuration_ownerships) } | ||
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | describe 'methods' do | 18 | describe 'methods' do |
| @@ -27,7 +27,7 @@ describe User do | @@ -27,7 +27,7 @@ describe User do | ||
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | it 'should return a list of projects owned by the user' do | 29 | it 'should return a list of projects owned by the user' do |
| 30 | - subject.projects.should eq([project]) | 30 | + expect(subject.projects).to eq([project]) |
| 31 | end | 31 | end |
| 32 | end | 32 | end |
| 33 | 33 | ||
| @@ -42,7 +42,7 @@ describe User do | @@ -42,7 +42,7 @@ describe User do | ||
| 42 | end | 42 | end |
| 43 | 43 | ||
| 44 | it 'should return a list of reading groups owned by the user' do | 44 | it 'should return a list of reading groups owned by the user' do |
| 45 | - subject.reading_groups.should eq([reading_group]) | 45 | + expect(subject.reading_groups).to eq([reading_group]) |
| 46 | end | 46 | end |
| 47 | end | 47 | end |
| 48 | 48 | ||
| @@ -57,7 +57,7 @@ describe User do | @@ -57,7 +57,7 @@ describe User do | ||
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | it 'should return a list of mezuro configurations owned by the user' do | 59 | it 'should return a list of mezuro configurations owned by the user' do |
| 60 | - subject.mezuro_configurations.should eq([mezuro_configuration]) | 60 | + expect(subject.mezuro_configurations).to eq([mezuro_configuration]) |
| 61 | end | 61 | end |
| 62 | end | 62 | end |
| 63 | end | 63 | end |
spec/models/validators/beginning_uniqueness_validator_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe BeginningUniquenessValidator do | 3 | +describe BeginningUniquenessValidator, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'validate_each' do | 5 | describe 'validate_each' do |
| 6 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } | 6 | let(:metric_configuration) { FactoryGirl.build(:metric_configuration) } |
| @@ -13,7 +13,7 @@ describe BeginningUniquenessValidator do | @@ -13,7 +13,7 @@ describe BeginningUniquenessValidator do | ||
| 13 | subject { FactoryGirl.build(:mezuro_range, metric_configuration_id: metric_configuration.id) } | 13 | subject { FactoryGirl.build(:mezuro_range, metric_configuration_id: metric_configuration.id) } |
| 14 | it 'should contain no errors' do | 14 | it 'should contain no errors' do |
| 15 | subject.save | 15 | subject.save |
| 16 | - subject.errors.should be_empty | 16 | + expect(subject.errors).to be_empty |
| 17 | end | 17 | end |
| 18 | end | 18 | end |
| 19 | 19 | ||
| @@ -26,7 +26,7 @@ describe BeginningUniquenessValidator do | @@ -26,7 +26,7 @@ describe BeginningUniquenessValidator do | ||
| 26 | 26 | ||
| 27 | it 'should contain errors' do | 27 | it 'should contain errors' do |
| 28 | @subject.save | 28 | @subject.save |
| 29 | - @subject.errors[:beginning].should eq(["There's already a MezuroRange with beginning #{@subject.beginning}! Please, choose another one."]) | 29 | + expect(@subject.errors[:beginning]).to eq(["There's already a MezuroRange with beginning #{@subject.beginning}! Please, choose another one."]) |
| 30 | end | 30 | end |
| 31 | end | 31 | end |
| 32 | end | 32 | end |
spec/models/validators/code_uniqueness_validator_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe CodeUniquenessValidator do | 3 | +describe CodeUniquenessValidator, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'validate_each' do | 5 | describe 'validate_each' do |
| 6 | context 'without saved metric_configurations' do | 6 | context 'without saved metric_configurations' do |
| @@ -12,7 +12,7 @@ describe CodeUniquenessValidator do | @@ -12,7 +12,7 @@ describe CodeUniquenessValidator do | ||
| 12 | subject { FactoryGirl.build(:metric_configuration) } | 12 | subject { FactoryGirl.build(:metric_configuration) } |
| 13 | it 'should contain no errors' do | 13 | it 'should contain no errors' do |
| 14 | subject.save | 14 | subject.save |
| 15 | - subject.errors.should be_empty | 15 | + expect(subject.errors).to be_empty |
| 16 | end | 16 | end |
| 17 | end | 17 | end |
| 18 | 18 | ||
| @@ -24,7 +24,7 @@ describe CodeUniquenessValidator do | @@ -24,7 +24,7 @@ describe CodeUniquenessValidator do | ||
| 24 | 24 | ||
| 25 | it 'should contain errors' do | 25 | it 'should contain errors' do |
| 26 | @subject.save | 26 | @subject.save |
| 27 | - @subject.errors[:code].should eq(["There's already a MetricConfiguration with code #{@subject.code}! Please, choose another one."]) | 27 | + expect(@subject.errors[:code]).to eq(["There's already a MetricConfiguration with code #{@subject.code}! Please, choose another one."]) |
| 28 | end | 28 | end |
| 29 | end | 29 | end |
| 30 | end | 30 | end |
spec/models/validators/kalibro_uniqueness_validator_spec.rb
| 1 | require 'spec_helper' | 1 | require 'spec_helper' |
| 2 | 2 | ||
| 3 | -describe KalibroUniquenessValidator do | 3 | +describe KalibroUniquenessValidator, :type => :model do |
| 4 | describe 'methods' do | 4 | describe 'methods' do |
| 5 | describe 'validate_each' do | 5 | describe 'validate_each' do |
| 6 | context 'without saved projects' do | 6 | context 'without saved projects' do |
| @@ -12,7 +12,7 @@ describe KalibroUniquenessValidator do | @@ -12,7 +12,7 @@ describe KalibroUniquenessValidator do | ||
| 12 | subject { FactoryGirl.build(:project) } | 12 | subject { FactoryGirl.build(:project) } |
| 13 | it 'should contain no errors' do | 13 | it 'should contain no errors' do |
| 14 | subject.save | 14 | subject.save |
| 15 | - subject.errors.should be_empty | 15 | + expect(subject.errors).to be_empty |
| 16 | end | 16 | end |
| 17 | end | 17 | end |
| 18 | 18 | ||
| @@ -24,7 +24,7 @@ describe KalibroUniquenessValidator do | @@ -24,7 +24,7 @@ describe KalibroUniquenessValidator do | ||
| 24 | 24 | ||
| 25 | it 'should contain errors' do | 25 | it 'should contain errors' do |
| 26 | @subject.save | 26 | @subject.save |
| 27 | - @subject.errors[:name].should eq(["There's already a Project with name #{@subject.name}! Please, choose another one."]) | 27 | + expect(@subject.errors[:name]).to eq(["There's already a Project with name #{@subject.name}! Please, choose another one."]) |
| 28 | end | 28 | end |
| 29 | end | 29 | end |
| 30 | end | 30 | end |
spec/routing/compound_metric_configurations_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe CompoundMetricConfigurationsController do | 3 | +describe CompoundMetricConfigurationsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/mezuro_configurations/1/compound_metric_configurations/new'). | 5 | + it { is_expected.to route(:get, '/mezuro_configurations/1/compound_metric_configurations/new'). |
| 6 | to(controller: :compound_metric_configurations, action: :new, mezuro_configuration_id: "1") } | 6 | to(controller: :compound_metric_configurations, action: :new, mezuro_configuration_id: "1") } |
| 7 | - it { should route(:get, '/mezuro_configurations/1/compound_metric_configurations'). | 7 | + it { is_expected.to route(:get, '/mezuro_configurations/1/compound_metric_configurations'). |
| 8 | to(controller: :compound_metric_configurations, action: :index, mezuro_configuration_id: "1") } | 8 | to(controller: :compound_metric_configurations, action: :index, mezuro_configuration_id: "1") } |
| 9 | - it { should route(:post, '/mezuro_configurations/1/compound_metric_configurations'). | 9 | + it { is_expected.to route(:post, '/mezuro_configurations/1/compound_metric_configurations'). |
| 10 | to(controller: :compound_metric_configurations, action: :create, mezuro_configuration_id: "1") } | 10 | to(controller: :compound_metric_configurations, action: :create, mezuro_configuration_id: "1") } |
| 11 | - it { should route(:get, '/mezuro_configurations/1/compound_metric_configurations/1'). | 11 | + it { is_expected.to route(:get, '/mezuro_configurations/1/compound_metric_configurations/1'). |
| 12 | to(controller: :compound_metric_configurations, action: :show, mezuro_configuration_id: "1", id: "1") } | 12 | to(controller: :compound_metric_configurations, action: :show, mezuro_configuration_id: "1", id: "1") } |
| 13 | - it { should route(:get, '/mezuro_configurations/1/compound_metric_configurations/1/edit'). | 13 | + it { is_expected.to route(:get, '/mezuro_configurations/1/compound_metric_configurations/1/edit'). |
| 14 | to(controller: :compound_metric_configurations, action: :edit, mezuro_configuration_id: "1", id: "1") } | 14 | to(controller: :compound_metric_configurations, action: :edit, mezuro_configuration_id: "1", id: "1") } |
| 15 | - it { should route(:put, '/mezuro_configurations/1/compound_metric_configurations/1'). | 15 | + it { is_expected.to route(:put, '/mezuro_configurations/1/compound_metric_configurations/1'). |
| 16 | to(controller: :compound_metric_configurations, action: :update, mezuro_configuration_id: "1", id: "1") } | 16 | to(controller: :compound_metric_configurations, action: :update, mezuro_configuration_id: "1", id: "1") } |
| 17 | - it { should_not route(:delete, '/mezuro_configurations/1/compound_metric_configurations/1'). | 17 | + it { is_expected.not_to route(:delete, '/mezuro_configurations/1/compound_metric_configurations/1'). |
| 18 | to(controller: :compound_metric_configurations, action: :destroy, mezuro_configuration_id: "1", id: "1") } | 18 | to(controller: :compound_metric_configurations, action: :destroy, mezuro_configuration_id: "1", id: "1") } |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
spec/routing/home_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe HomeController do | 3 | +describe HomeController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/'). | 5 | + it { is_expected.to route(:get, '/'). |
| 6 | to(controller: :home, action: :index) } | 6 | to(controller: :home, action: :index) } |
| 7 | end | 7 | end |
| 8 | end | 8 | end |
| 9 | \ No newline at end of file | 9 | \ No newline at end of file |
spec/routing/metric_configurations_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe MetricConfigurationsController do | 3 | +describe MetricConfigurationsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:post, '/mezuro_configurations/1/metric_configurations/new'). | 5 | + it { is_expected.to route(:post, '/mezuro_configurations/1/metric_configurations/new'). |
| 6 | to(controller: :metric_configurations, action: :new, mezuro_configuration_id: "1") } | 6 | to(controller: :metric_configurations, action: :new, mezuro_configuration_id: "1") } |
| 7 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations'). | 7 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations'). |
| 8 | to(controller: :metric_configurations, action: :index, mezuro_configuration_id: "1") } | 8 | to(controller: :metric_configurations, action: :index, mezuro_configuration_id: "1") } |
| 9 | - it { should route(:post, '/mezuro_configurations/1/metric_configurations'). | 9 | + it { is_expected.to route(:post, '/mezuro_configurations/1/metric_configurations'). |
| 10 | to(controller: :metric_configurations, action: :create, mezuro_configuration_id: "1") } | 10 | to(controller: :metric_configurations, action: :create, mezuro_configuration_id: "1") } |
| 11 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1'). | 11 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1'). |
| 12 | to(controller: :metric_configurations, action: :show, mezuro_configuration_id: "1", id: "1") } | 12 | to(controller: :metric_configurations, action: :show, mezuro_configuration_id: "1", id: "1") } |
| 13 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/edit'). | 13 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1/edit'). |
| 14 | to(controller: :metric_configurations, action: :edit, mezuro_configuration_id: "1", id: "1") } | 14 | to(controller: :metric_configurations, action: :edit, mezuro_configuration_id: "1", id: "1") } |
| 15 | - it { should route(:put, '/mezuro_configurations/1/metric_configurations/1'). | 15 | + it { is_expected.to route(:put, '/mezuro_configurations/1/metric_configurations/1'). |
| 16 | to(controller: :metric_configurations, action: :update, mezuro_configuration_id: "1", id: "1") } | 16 | to(controller: :metric_configurations, action: :update, mezuro_configuration_id: "1", id: "1") } |
| 17 | - it { should route(:delete, '/mezuro_configurations/1/metric_configurations/1'). | 17 | + it { is_expected.to route(:delete, '/mezuro_configurations/1/metric_configurations/1'). |
| 18 | to(controller: :metric_configurations, action: :destroy, mezuro_configuration_id: "1", id: "1") } | 18 | to(controller: :metric_configurations, action: :destroy, mezuro_configuration_id: "1", id: "1") } |
| 19 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/choose_metric'). | 19 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/choose_metric'). |
| 20 | to(controller: :metric_configurations, action: :choose_metric, mezuro_configuration_id: "1") } | 20 | to(controller: :metric_configurations, action: :choose_metric, mezuro_configuration_id: "1") } |
| 21 | end | 21 | end |
| 22 | end | 22 | end |
spec/routing/mezuro_configuration_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe MezuroConfigurationsController do | 3 | +describe MezuroConfigurationsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/mezuro_configurations/new'). | 5 | + it { is_expected.to route(:get, '/mezuro_configurations/new'). |
| 6 | to(controller: :mezuro_configurations, action: :new) } | 6 | to(controller: :mezuro_configurations, action: :new) } |
| 7 | - it { should route(:get, '/mezuro_configurations'). | 7 | + it { is_expected.to route(:get, '/mezuro_configurations'). |
| 8 | to(controller: :mezuro_configurations, action: :index) } | 8 | to(controller: :mezuro_configurations, action: :index) } |
| 9 | - it { should route(:post, '/mezuro_configurations'). | 9 | + it { is_expected.to route(:post, '/mezuro_configurations'). |
| 10 | to(controller: :mezuro_configurations, action: :create) } | 10 | to(controller: :mezuro_configurations, action: :create) } |
| 11 | - it { should route(:get, '/mezuro_configurations/1'). | 11 | + it { is_expected.to route(:get, '/mezuro_configurations/1'). |
| 12 | to(controller: :mezuro_configurations, action: :show, id: "1") } | 12 | to(controller: :mezuro_configurations, action: :show, id: "1") } |
| 13 | - it { should route(:get, '/mezuro_configurations/1/edit'). | 13 | + it { is_expected.to route(:get, '/mezuro_configurations/1/edit'). |
| 14 | to(controller: :mezuro_configurations, action: :edit, id: "1") } | 14 | to(controller: :mezuro_configurations, action: :edit, id: "1") } |
| 15 | - it { should route(:put, '/mezuro_configurations/1'). | 15 | + it { is_expected.to route(:put, '/mezuro_configurations/1'). |
| 16 | to(controller: :mezuro_configurations, action: :update, id: "1") } | 16 | to(controller: :mezuro_configurations, action: :update, id: "1") } |
| 17 | - it { should route(:delete, '/mezuro_configurations/1'). | 17 | + it { is_expected.to route(:delete, '/mezuro_configurations/1'). |
| 18 | to(controller: :mezuro_configurations, action: :destroy, id: "1") } | 18 | to(controller: :mezuro_configurations, action: :destroy, id: "1") } |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
spec/routing/mezuro_ranges_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe MezuroRangesController do | 3 | +describe MezuroRangesController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). | 5 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). |
| 6 | to(controller: :mezuro_ranges, action: :index, mezuro_configuration_id: "1", metric_configuration_id: "1") } | 6 | to(controller: :mezuro_ranges, action: :index, mezuro_configuration_id: "1", metric_configuration_id: "1") } |
| 7 | - it { should route(:post, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). | 7 | + it { is_expected.to route(:post, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges'). |
| 8 | to(controller: :mezuro_ranges, action: :create, mezuro_configuration_id: "1", metric_configuration_id: "1") } | 8 | to(controller: :mezuro_ranges, action: :create, mezuro_configuration_id: "1", metric_configuration_id: "1") } |
| 9 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1/edit'). | 9 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1/edit'). |
| 10 | to(controller: :mezuro_ranges, action: :edit, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | 10 | to(controller: :mezuro_ranges, action: :edit, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } |
| 11 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | 11 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). |
| 12 | to(controller: :mezuro_ranges, action: :show, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | 12 | to(controller: :mezuro_ranges, action: :show, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } |
| 13 | - it { should route(:delete, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | 13 | + it { is_expected.to route(:delete, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). |
| 14 | to(controller: :mezuro_ranges, action: :destroy, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | 14 | to(controller: :mezuro_ranges, action: :destroy, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } |
| 15 | - it { should route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/new'). | 15 | + it { is_expected.to route(:get, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/new'). |
| 16 | to(controller: :mezuro_ranges, action: :new, mezuro_configuration_id: "1", metric_configuration_id: "1") } | 16 | to(controller: :mezuro_ranges, action: :new, mezuro_configuration_id: "1", metric_configuration_id: "1") } |
| 17 | - it { should route(:put, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). | 17 | + it { is_expected.to route(:put, '/mezuro_configurations/1/metric_configurations/1/mezuro_ranges/1'). |
| 18 | to(controller: :mezuro_ranges, action: :update, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } | 18 | to(controller: :mezuro_ranges, action: :update, mezuro_configuration_id: "1", metric_configuration_id: "1", id: "1") } |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
spec/routing/modules_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe ModulesController do | 3 | +describe ModulesController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:post, '/modules/1/tree'). | 5 | + it { is_expected.to route(:post, '/modules/1/tree'). |
| 6 | to(controller: :modules, action: :load_module_tree, id: 1) } | 6 | to(controller: :modules, action: :load_module_tree, id: 1) } |
| 7 | - it { should route(:post, '/modules/1/metric_history'). | 7 | + it { is_expected.to route(:post, '/modules/1/metric_history'). |
| 8 | to(controller: :modules, action: :metric_history, id: 1) } | 8 | to(controller: :modules, action: :metric_history, id: 1) } |
| 9 | end | 9 | end |
| 10 | end | 10 | end |
| 11 | \ No newline at end of file | 11 | \ No newline at end of file |
spec/routing/project_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe ProjectsController do | 3 | +describe ProjectsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/projects/new'). | 5 | + it { is_expected.to route(:get, '/projects/new'). |
| 6 | to(controller: :projects, action: :new) } | 6 | to(controller: :projects, action: :new) } |
| 7 | 7 | ||
| 8 | - it { should route(:get, '/projects'). | 8 | + it { is_expected.to route(:get, '/projects'). |
| 9 | to(controller: :projects, action: :index) } | 9 | to(controller: :projects, action: :index) } |
| 10 | 10 | ||
| 11 | - it { should route(:post, '/projects'). | 11 | + it { is_expected.to route(:post, '/projects'). |
| 12 | to(controller: :projects, action: :create) } | 12 | to(controller: :projects, action: :create) } |
| 13 | 13 | ||
| 14 | - it { should route(:get, '/projects/1'). | 14 | + it { is_expected.to route(:get, '/projects/1'). |
| 15 | to(controller: :projects, action: :show, id: "1") } | 15 | to(controller: :projects, action: :show, id: "1") } |
| 16 | 16 | ||
| 17 | - it { should route(:get, '/projects/1/edit'). | 17 | + it { is_expected.to route(:get, '/projects/1/edit'). |
| 18 | to(controller: :projects, action: :edit, id: "1") } | 18 | to(controller: :projects, action: :edit, id: "1") } |
| 19 | 19 | ||
| 20 | - it { should route(:put, '/projects/1'). | 20 | + it { is_expected.to route(:put, '/projects/1'). |
| 21 | to(controller: :projects, action: :update, id: "1") } | 21 | to(controller: :projects, action: :update, id: "1") } |
| 22 | 22 | ||
| 23 | - it { should route(:delete, '/projects/1'). | 23 | + it { is_expected.to route(:delete, '/projects/1'). |
| 24 | to(controller: :projects, action: :destroy, id: "1") } | 24 | to(controller: :projects, action: :destroy, id: "1") } |
| 25 | end | 25 | end |
| 26 | end | 26 | end |
| 27 | \ No newline at end of file | 27 | \ No newline at end of file |
spec/routing/reading_groups_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe ReadingGroupsController do | 3 | +describe ReadingGroupsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/reading_groups/new'). | 5 | + it { is_expected.to route(:get, '/reading_groups/new'). |
| 6 | to(controller: :reading_groups, action: :new) } | 6 | to(controller: :reading_groups, action: :new) } |
| 7 | 7 | ||
| 8 | - it { should route(:get, '/reading_groups'). | 8 | + it { is_expected.to route(:get, '/reading_groups'). |
| 9 | to(controller: :reading_groups, action: :index) } | 9 | to(controller: :reading_groups, action: :index) } |
| 10 | 10 | ||
| 11 | - it { should route(:post, '/reading_groups'). | 11 | + it { is_expected.to route(:post, '/reading_groups'). |
| 12 | to(controller: :reading_groups, action: :create) } | 12 | to(controller: :reading_groups, action: :create) } |
| 13 | 13 | ||
| 14 | - it { should route(:get, '/reading_groups/1'). | 14 | + it { is_expected.to route(:get, '/reading_groups/1'). |
| 15 | to(controller: :reading_groups, action: :show, id: "1") } | 15 | to(controller: :reading_groups, action: :show, id: "1") } |
| 16 | 16 | ||
| 17 | - it { should route(:get, '/reading_groups/1/edit'). | 17 | + it { is_expected.to route(:get, '/reading_groups/1/edit'). |
| 18 | to(controller: :reading_groups, action: :edit, id: "1") } | 18 | to(controller: :reading_groups, action: :edit, id: "1") } |
| 19 | 19 | ||
| 20 | - it { should route(:put, '/reading_groups/1'). | 20 | + it { is_expected.to route(:put, '/reading_groups/1'). |
| 21 | to(controller: :reading_groups, action: :update, id: "1") } | 21 | to(controller: :reading_groups, action: :update, id: "1") } |
| 22 | 22 | ||
| 23 | - it { should route(:delete, '/reading_groups/1'). | 23 | + it { is_expected.to route(:delete, '/reading_groups/1'). |
| 24 | to(controller: :reading_groups, action: :destroy, id: "1") } | 24 | to(controller: :reading_groups, action: :destroy, id: "1") } |
| 25 | end | 25 | end |
| 26 | end | 26 | end |
spec/routing/readings_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe ReadingsController do | 3 | +describe ReadingsController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:post, '/reading_groups/1/readings'). | 5 | + it { is_expected.to route(:post, '/reading_groups/1/readings'). |
| 6 | to(controller: :readings, action: :create, reading_group_id: 1) } | 6 | to(controller: :readings, action: :create, reading_group_id: 1) } |
| 7 | - it { should route(:get, '/reading_groups/1/readings/new'). | 7 | + it { is_expected.to route(:get, '/reading_groups/1/readings/new'). |
| 8 | to(controller: :readings, action: :new, reading_group_id: 1) } | 8 | to(controller: :readings, action: :new, reading_group_id: 1) } |
| 9 | - it { should route(:get, '/reading_groups/1/readings/1/edit'). | 9 | + it { is_expected.to route(:get, '/reading_groups/1/readings/1/edit'). |
| 10 | to(controller: :readings, action: :edit, reading_group_id: 1, id: 1) } | 10 | to(controller: :readings, action: :edit, reading_group_id: 1, id: 1) } |
| 11 | - it { should_not route(:get, '/reading_groups/1/readings/1'). | 11 | + it { is_expected.not_to route(:get, '/reading_groups/1/readings/1'). |
| 12 | to(controller: :readings, action: :show, reading_group_id: 1, id: 1) } | 12 | to(controller: :readings, action: :show, reading_group_id: 1, id: 1) } |
| 13 | - it { should route(:delete, '/reading_groups/1/readings/1'). | 13 | + it { is_expected.to route(:delete, '/reading_groups/1/readings/1'). |
| 14 | to(controller: :readings, action: :destroy, reading_group_id: 1, id: 1) } | 14 | to(controller: :readings, action: :destroy, reading_group_id: 1, id: 1) } |
| 15 | - it { should route(:put, '/reading_groups/1/readings/1'). | 15 | + it { is_expected.to route(:put, '/reading_groups/1/readings/1'). |
| 16 | to(controller: :readings, action: :update, reading_group_id: 1, id: 1) } | 16 | to(controller: :readings, action: :update, reading_group_id: 1, id: 1) } |
| 17 | - it { should_not route(:get, '/reading_groups/1/readings'). | 17 | + it { is_expected.not_to route(:get, '/reading_groups/1/readings'). |
| 18 | to(controller: :readings, action: :index, reading_group_id: 1) } | 18 | to(controller: :readings, action: :index, reading_group_id: 1) } |
| 19 | end | 19 | end |
| 20 | end | 20 | end |
spec/routing/repositories_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe RepositoriesController do | 3 | +describe RepositoriesController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:post, '/projects/1/repositories'). | 5 | + it { is_expected.to route(:post, '/projects/1/repositories'). |
| 6 | to(controller: :repositories, action: :create, project_id: 1) } | 6 | to(controller: :repositories, action: :create, project_id: 1) } |
| 7 | - it { should route(:get, '/projects/1/repositories/new'). | 7 | + it { is_expected.to route(:get, '/projects/1/repositories/new'). |
| 8 | to(controller: :repositories, action: :new, project_id: 1) } | 8 | to(controller: :repositories, action: :new, project_id: 1) } |
| 9 | - it { should route(:get, '/projects/1/repositories/1/edit'). | 9 | + it { is_expected.to route(:get, '/projects/1/repositories/1/edit'). |
| 10 | to(controller: :repositories, action: :edit, project_id: 1, id: 1) } | 10 | to(controller: :repositories, action: :edit, project_id: 1, id: 1) } |
| 11 | - it { should route(:get, '/projects/1/repositories/1'). | 11 | + it { is_expected.to route(:get, '/projects/1/repositories/1'). |
| 12 | to(controller: :repositories, action: :show, project_id: 1, id: 1) } | 12 | to(controller: :repositories, action: :show, project_id: 1, id: 1) } |
| 13 | - it { should route(:get, '/projects/1/repositories/1/modules/1'). | 13 | + it { is_expected.to route(:get, '/projects/1/repositories/1/modules/1'). |
| 14 | to(controller: :repositories, action: :show, project_id: 1, module_result_id: 1, id: 1) } | 14 | to(controller: :repositories, action: :show, project_id: 1, module_result_id: 1, id: 1) } |
| 15 | - it { should route(:delete, '/projects/1/repositories/1'). | 15 | + it { is_expected.to route(:delete, '/projects/1/repositories/1'). |
| 16 | to(controller: :repositories, action: :destroy, project_id: 1, id: 1) } | 16 | to(controller: :repositories, action: :destroy, project_id: 1, id: 1) } |
| 17 | - it { should route(:put, '/projects/1/repositories/1'). | 17 | + it { is_expected.to route(:put, '/projects/1/repositories/1'). |
| 18 | to(controller: :repositories, action: :update, project_id: 1, id: 1) } | 18 | to(controller: :repositories, action: :update, project_id: 1, id: 1) } |
| 19 | - it { should_not route(:get, '/projects/1/repositories'). | 19 | + it { is_expected.not_to route(:get, '/projects/1/repositories'). |
| 20 | to(controller: :repositories, action: :index, project_id: 1) } | 20 | to(controller: :repositories, action: :index, project_id: 1) } |
| 21 | - it { should route(:post, '/projects/1/repositories/1/state'). | 21 | + it { is_expected.to route(:post, '/projects/1/repositories/1/state'). |
| 22 | to(controller: :repositories, action: :state, project_id: 1, id: 1) } | 22 | to(controller: :repositories, action: :state, project_id: 1, id: 1) } |
| 23 | - it { should route(:get, '/projects/1/repositories/1/process'). | 23 | + it { is_expected.to route(:get, '/projects/1/repositories/1/process'). |
| 24 | to(controller: :repositories, action: :process_repository, project_id: 1, id: 1) } | 24 | to(controller: :repositories, action: :process_repository, project_id: 1, id: 1) } |
| 25 | end | 25 | end |
| 26 | end | 26 | end |
spec/routing/user_routing_spec.rb
| 1 | require "spec_helper" | 1 | require "spec_helper" |
| 2 | 2 | ||
| 3 | -describe UsersController do | 3 | +describe UsersController, :type => :routing do |
| 4 | describe "routing" do | 4 | describe "routing" do |
| 5 | - it { should route(:get, '/users/1/projects'). | 5 | + it { is_expected.to route(:get, '/users/1/projects'). |
| 6 | to(controller: :users, action: :projects, user_id: 1) } | 6 | to(controller: :users, action: :projects, user_id: 1) } |
| 7 | end | 7 | end |
| 8 | end | 8 | end |
| 9 | \ No newline at end of file | 9 | \ No newline at end of file |