diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-02-12 11:52:59 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-02-12 11:52:59 +0000 |
commit | bd01d79f73f22f6e748a3c0a6489e0a3e3d1f18f (patch) | |
tree | e9b5e68c37771bcf54bc72557c29008756397bff /spec/controllers | |
parent | d0d94e4f104c276ee4095a76d1204daae384c708 (diff) | |
parent | edb8ed36cd5ce315ca45a047bd06ab1dfcf44203 (diff) | |
download | gitlab-ce-bd01d79f73f22f6e748a3c0a6489e0a3e3d1f18f.tar.gz |
Merge branch 'master' into fe-paginated-environments-api
* master: (97 commits)
convert js-cookie dependency to an npm module
convert timeago.js dependency to an npm module
remove vue from vendor since it is now in node_modules
Add CHANGELOG file
Stylize blockquote in notification emails
Add js prefix to right sidebar
Replace accidentally deleted metaclick
Remove right padding from navbar-collapse on large screens
Add changelog
common_utils merge conflicts
Set sidebar height to 100% if at top of page
Set height of fixed sidebars with js
Add sticky sidebar on wiki page
Fix comment button test for slash commands
Fix time tracking spec
Fix issue boards sidebar alignment and sidebar toggle spec
Fix failing conflicts test
Fix build sidebar scrolling
Refactor JS
Fix pinned sidebar alignment
...
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/uploads_controller_spec.rb | 64 |
1 files changed, 10 insertions, 54 deletions
diff --git a/spec/controllers/projects/uploads_controller_spec.rb b/spec/controllers/projects/uploads_controller_spec.rb index f1c8891e87a..0347e789576 100644 --- a/spec/controllers/projects/uploads_controller_spec.rb +++ b/spec/controllers/projects/uploads_controller_spec.rb @@ -170,68 +170,24 @@ describe Projects::UploadsController do project.team << [user, :master] end - context "when the user is blocked" do + context "when the file exists" do before do - user.block - project.team << [user, :master] - end - - context "when the file exists" do - before do - allow_any_instance_of(FileUploader).to receive(:file).and_return(jpg) - allow(jpg).to receive(:exists?).and_return(true) - end - - context "when the file is an image" do - before do - allow_any_instance_of(FileUploader).to receive(:image?).and_return(true) - end - - it "responds with status 200" do - go - - expect(response).to have_http_status(200) - end - end - - context "when the file is not an image" do - it "redirects to the sign in page" do - go - - expect(response).to redirect_to(new_user_session_path) - end - end + allow_any_instance_of(FileUploader).to receive(:file).and_return(jpg) + allow(jpg).to receive(:exists?).and_return(true) end - context "when the file doesn't exist" do - it "redirects to the sign in page" do - go + it "responds with status 200" do + go - expect(response).to redirect_to(new_user_session_path) - end + expect(response).to have_http_status(200) end end - context "when the user isn't blocked" do - context "when the file exists" do - before do - allow_any_instance_of(FileUploader).to receive(:file).and_return(jpg) - allow(jpg).to receive(:exists?).and_return(true) - end - - it "responds with status 200" do - go - - expect(response).to have_http_status(200) - end - end - - context "when the file doesn't exist" do - it "responds with status 404" do - go + context "when the file doesn't exist" do + it "responds with status 404" do + go - expect(response).to have_http_status(404) - end + expect(response).to have_http_status(404) end end end |