Fix specs. Fix note form reset after submit

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-05-24 14:10:36 +03:00
parent 7c6a58a756
commit 1bb9aeb565
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
5 changed files with 3 additions and 37 deletions

View File

@ -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 ""

View File

@ -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

View File

@ -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) }

View File

@ -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) }

View File

@ -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) }