summaryrefslogtreecommitdiff
path: root/spec/controllers/blob_controller_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-12 16:47:06 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-12 16:47:06 -0800
commit1343b2dfac288eb60d536cc3d1a94de1eb178b51 (patch)
tree9b593febf0ca24c2ae4c68fa4a44e058dd512f94 /spec/controllers/blob_controller_spec.rb
parentf9880c11f754c278cbd00eb34ea65e90160571db (diff)
parent686000446639fbf0756733c822a1ebb19e09e121 (diff)
downloadgitlab-ce-1343b2dfac288eb60d536cc3d1a94de1eb178b51.tar.gz
Merge pull request #8785 from jvanbaarsen/rspec-upgrade
Rspec upgrade
Diffstat (limited to 'spec/controllers/blob_controller_spec.rb')
-rw-r--r--spec/controllers/blob_controller_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb
index 11d748ca77f..ea52e4d212a 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,10 @@ 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 'redirects' do
+ expect(subject).
+ to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc")
+ end
end
end
end