summaryrefslogtreecommitdiff
path: root/spec/features/projects/branches/user_views_branches_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/branches/user_views_branches_spec.rb')
-rw-r--r--spec/features/projects/branches/user_views_branches_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/features/projects/branches/user_views_branches_spec.rb b/spec/features/projects/branches/user_views_branches_spec.rb
new file mode 100644
index 00000000000..62ae793151c
--- /dev/null
+++ b/spec/features/projects/branches/user_views_branches_spec.rb
@@ -0,0 +1,34 @@
+require "spec_helper"
+
+describe "User views branches" do
+ set(:project) { create(:project, :repository) }
+ set(:user) { project.owner }
+
+ before do
+ sign_in(user)
+ end
+
+ context "all branches" do
+ before do
+ visit(project_branches_path(project))
+ end
+
+ it "shows branches" do
+ expect(page).to have_content("Branches").and have_content("master")
+ end
+ end
+
+ context "protected branches" do
+ set(:protected_branch) { create(:protected_branch, project: project) }
+
+ before do
+ visit(project_protected_branches_path(project))
+ end
+
+ it "shows branches" do
+ page.within(".protected-branches-list") do
+ expect(page).to have_content(protected_branch.name).and have_no_content("master")
+ end
+ end
+ end
+end