From 0c4a70a306b871899bf87ce4673918abfee4d95f Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 19:17:35 +0100 Subject: Updated rspec to rspec 3.x syntax Signed-off-by: Jeroen van Baarsen --- spec/controllers/blob_controller_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'spec/controllers/blob_controller_spec.rb') diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index 11d748ca77f..02f418053fa 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -9,8 +9,8 @@ describe Projects::BlobController do project.team << [user, :master] - project.stub(:branches).and_return(['master', 'foo/bar/baz']) - project.stub(:tags).and_return(['v1.0.0', 'v2.0.0']) + allow(project).to receive(:branches).and_return(['master', 'foo/bar/baz']) + allow(project).to receive(:tags).and_return(['v1.0.0', 'v2.0.0']) controller.instance_variable_set(:@project, project) end @@ -21,17 +21,17 @@ describe Projects::BlobController do context "valid branch, valid file" do let(:id) { 'master/README.md' } - it { should respond_with(:success) } + it { is_expected.to respond_with(:success) } end context "valid branch, invalid file" do let(:id) { 'master/invalid-path.rb' } - it { should respond_with(:not_found) } + it { is_expected.to respond_with(:not_found) } end context "invalid branch, valid file" do let(:id) { 'invalid-branch/README.md' } - it { should respond_with(:not_found) } + it { is_expected.to respond_with(:not_found) } end end @@ -45,7 +45,7 @@ describe Projects::BlobController do context 'redirect to tree' do let(:id) { 'markdown/doc' } - it { should redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") } + it { is_expected.to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") } end end end -- cgit v1.2.1 From 940a402b6e015cde1b3513808cb9ac7f0a3bec8c Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 19:32:58 +0100 Subject: Fixed hound warnings Signed-off-by: Jeroen van Baarsen --- spec/controllers/blob_controller_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'spec/controllers/blob_controller_spec.rb') diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index 02f418053fa..02a9db61255 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -45,7 +45,10 @@ describe Projects::BlobController do context 'redirect to tree' do let(:id) { 'markdown/doc' } - it { is_expected.to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") } + it "redirects" do + expect(subject). + to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") + end end end end -- cgit v1.2.1 From 026e988544f282c87afec9a85ff21a23877f6226 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 19:53:23 +0100 Subject: Even more hound fixes Signed-off-by: Jeroen van Baarsen --- spec/controllers/blob_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/blob_controller_spec.rb') diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index 02a9db61255..ea52e4d212a 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -45,7 +45,7 @@ describe Projects::BlobController do context 'redirect to tree' do let(:id) { 'markdown/doc' } - it "redirects" do + it 'redirects' do expect(subject). to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") end -- cgit v1.2.1 From 76aad9b76ed756ca9ba2cbcdb399c815e542b3ae Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Sat, 24 Jan 2015 11:02:58 -0700 Subject: Upgrade to Rails 4.1.9 Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers. --- spec/controllers/blob_controller_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spec/controllers/blob_controller_spec.rb') diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index ea52e4d212a..a1102f28340 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -17,7 +17,10 @@ describe Projects::BlobController do describe "GET show" do render_views - before { get :show, project_id: project.to_param, id: id } + before do + get(:show, namespace_id: project.namespace.to_param, + project_id: project.to_param, id: id) + end context "valid branch, valid file" do let(:id) { 'master/README.md' } @@ -39,7 +42,8 @@ describe Projects::BlobController do render_views before do - get :show, project_id: project.to_param, id: id + get(:show, namespace_id: project.namespace.to_param, + project_id: project.to_param, id: id) controller.instance_variable_set(:@blob, nil) end -- cgit v1.2.1