summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorCristian Bica <cristian.bica@gmail.com>2015-10-01 17:05:20 +0300
committerCristian Bica <cristian.bica@gmail.com>2015-10-01 17:05:20 +0300
commitc5280434399ee489eebda254b2d246252df68f2b (patch)
tree4a208c29c40202d5341534e5f822aea120d3a2b1 /spec/controllers
parent2e8a3e3996f47a5b436bce9a6bbb61ca0a351cab (diff)
downloadgitlab-ce-c5280434399ee489eebda254b2d246252df68f2b.tar.gz
Allow users to select the Files view as default project view
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index 29233e9fae6..1e018acf42a 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -21,6 +21,31 @@ describe ProjectsController do
expect(response.body).to include("content='#{content}'")
end
end
+
+ context "rendering default project view" do
+ render_views
+
+ it "shold render the activity view", focus: true do
+ allow(controller).to receive(:current_user).and_return(user)
+ allow(user).to receive(:project_view).and_return('activity')
+ get :show, namespace_id: public_project.namespace.path, id: public_project.path
+ expect(response).to render_template('_activity')
+ end
+
+ it "shold render the readme view", focus: true do
+ allow(controller).to receive(:current_user).and_return(user)
+ allow(user).to receive(:project_view).and_return('readme')
+ get :show, namespace_id: public_project.namespace.path, id: public_project.path
+ expect(response).to render_template('_readme')
+ end
+
+ it "shold render the files view", focus: true do
+ allow(controller).to receive(:current_user).and_return(user)
+ allow(user).to receive(:project_view).and_return('files')
+ get :show, namespace_id: public_project.namespace.path, id: public_project.path
+ expect(response).to render_template('_files')
+ end
+ end
end
describe "POST #toggle_star" do