Commit 1bb9aeb5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix specs. Fix note form reset after submit

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7c6a58a7
...@@ -203,8 +203,7 @@ class Notes ...@@ -203,8 +203,7 @@ class Notes
form.find(".js-errors").remove() form.find(".js-errors").remove()
# reset text and preview # reset text and preview
previewContainer = form.find(".note-edit-and-preview") form.find(".js-note-write-button").click()
previewContainer.removeClass "on" if previewContainer.is(".on")
form.find(".js-note-text").val("").trigger "input" form.find(".js-note-text").val("").trigger "input"
### ###
...@@ -254,7 +253,7 @@ class Notes ...@@ -254,7 +253,7 @@ class Notes
form.removeClass "js-new-note-form" form.removeClass "js-new-note-form"
# setup preview buttons # 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") previewButton = form.find(".js-note-preview-button")
form.find(".js-note-text").on "input", -> form.find(".js-note-text").on "input", ->
if $(this).val().trim() isnt "" if $(this).val().trim() isnt ""
......
...@@ -44,7 +44,7 @@ describe "On a merge request", js: true, feature: true do ...@@ -44,7 +44,7 @@ describe "On a merge request", js: true, feature: true do
it 'should have text and visible edit button' 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", 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-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 end
end end
......
...@@ -190,17 +190,6 @@ describe "Internal Project Access", feature: true do ...@@ -190,17 +190,6 @@ describe "Internal Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end 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 describe "GET /:project_path/branches" do
subject { project_branches_path(project) } subject { project_branches_path(project) }
......
...@@ -168,17 +168,6 @@ describe "Private Project Access", feature: true do ...@@ -168,17 +168,6 @@ describe "Private Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end 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 describe "GET /:project_path/branches" do
subject { project_branches_path(project) } subject { project_branches_path(project) }
......
...@@ -195,17 +195,6 @@ describe "Public Project Access", feature: true do ...@@ -195,17 +195,6 @@ describe "Public Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end 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 describe "GET /:project_path/branches" do
subject { project_branches_path(project) } subject { project_branches_path(project) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment