From 1bb9aeb565fca50304881e36488b202455bdddd2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 24 May 2014 14:10:36 +0300 Subject: [PATCH] Fix specs. Fix note form reset after submit --- app/assets/javascripts/notes.js.coffee | 5 ++--- spec/features/notes_on_merge_requests_spec.rb | 2 +- spec/features/security/project/internal_access_spec.rb | 11 ----------- spec/features/security/project/private_access_spec.rb | 11 ----------- spec/features/security/project/public_access_spec.rb | 11 ----------- 5 files changed, 3 insertions(+), 37 deletions(-) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 5be001e..a41ee67 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -203,8 +203,7 @@ class Notes form.find(".js-errors").remove() # reset text and preview - previewContainer = form.find(".note-edit-and-preview") - previewContainer.removeClass "on" if previewContainer.is(".on") + form.find(".js-note-write-button").click() form.find(".js-note-text").val("").trigger "input" ### @@ -254,7 +253,7 @@ class Notes form.removeClass "js-new-note-form" # setup preview buttons - form.find(".js-note-edit-button, .js-note-preview-button").tooltip placement: "left" + form.find(".js-note-write-button, .js-note-preview-button").tooltip placement: "left" previewButton = form.find(".js-note-preview-button") form.find(".js-note-text").on "input", -> if $(this).val().trim() isnt "" diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index 45aebf1..7f1da3c 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -44,7 +44,7 @@ describe "On a merge request", js: true, feature: true do it 'should have text and visible edit button' do within(".js-main-target-form") { should have_css(".js-note-preview", text: "This is awesome", visible: true) } within(".js-main-target-form") { should have_css(".js-note-preview-button", visible: false) } - within(".js-main-target-form") { should have_css(".js-note-edit-button", visible: true) } + within(".js-main-target-form") { should have_css(".js-note-write-button", visible: true) } end end end diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb index f6ab47e..eb8422d 100644 --- a/spec/features/security/project/internal_access_spec.rb +++ b/spec/features/security/project/internal_access_spec.rb @@ -190,17 +190,6 @@ describe "Internal Project Access", feature: true do it { should be_denied_for :visitor } end - describe "GET /:project_path/branches/recent" do - subject { recent_project_branches_path(project) } - - it { should be_allowed_for master } - it { should be_allowed_for reporter } - it { should be_allowed_for :admin } - it { should be_allowed_for guest } - it { should be_allowed_for :user } - it { should be_denied_for :visitor } - end - describe "GET /:project_path/branches" do subject { project_branches_path(project) } diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index 8a0fcb8..186ad35 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -168,17 +168,6 @@ describe "Private Project Access", feature: true do it { should be_denied_for :visitor } end - describe "GET /:project_path/branches/recent" do - subject { recent_project_branches_path(project) } - - it { should be_allowed_for master } - it { should be_allowed_for reporter } - it { should be_allowed_for :admin } - it { should be_denied_for guest } - it { should be_denied_for :user } - it { should be_denied_for :visitor } - end - describe "GET /:project_path/branches" do subject { project_branches_path(project) } diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb index eb511bf..f5d1cf7 100644 --- a/spec/features/security/project/public_access_spec.rb +++ b/spec/features/security/project/public_access_spec.rb @@ -195,17 +195,6 @@ describe "Public Project Access", feature: true do it { should be_denied_for :visitor } end - describe "GET /:project_path/branches/recent" do - subject { recent_project_branches_path(project) } - - it { should be_allowed_for master } - it { should be_allowed_for reporter } - it { should be_allowed_for :admin } - it { should be_allowed_for guest } - it { should be_allowed_for :user } - it { should be_allowed_for :visitor } - end - describe "GET /:project_path/branches" do subject { project_branches_path(project) } -- libgit2 0.21.2