Commit 1bb9aeb565fca50304881e36488b202455bdddd2
1 parent
7c6a58a7
Exists in
spb-stable
and in
2 other branches
Fix specs. Fix note form reset after submit
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
5 changed files
with
3 additions
and
37 deletions
Show diff stats
app/assets/javascripts/notes.js.coffee
... | ... | @@ -203,8 +203,7 @@ class Notes |
203 | 203 | form.find(".js-errors").remove() |
204 | 204 | |
205 | 205 | # reset text and preview |
206 | - previewContainer = form.find(".note-edit-and-preview") | |
207 | - previewContainer.removeClass "on" if previewContainer.is(".on") | |
206 | + form.find(".js-note-write-button").click() | |
208 | 207 | form.find(".js-note-text").val("").trigger "input" |
209 | 208 | |
210 | 209 | ### |
... | ... | @@ -254,7 +253,7 @@ class Notes |
254 | 253 | form.removeClass "js-new-note-form" |
255 | 254 | |
256 | 255 | # setup preview buttons |
257 | - form.find(".js-note-edit-button, .js-note-preview-button").tooltip placement: "left" | |
256 | + form.find(".js-note-write-button, .js-note-preview-button").tooltip placement: "left" | |
258 | 257 | previewButton = form.find(".js-note-preview-button") |
259 | 258 | form.find(".js-note-text").on "input", -> |
260 | 259 | if $(this).val().trim() isnt "" | ... | ... |
spec/features/notes_on_merge_requests_spec.rb
... | ... | @@ -44,7 +44,7 @@ describe "On a merge request", js: true, feature: true do |
44 | 44 | it 'should have text and visible edit button' do |
45 | 45 | within(".js-main-target-form") { should have_css(".js-note-preview", text: "This is awesome", visible: true) } |
46 | 46 | within(".js-main-target-form") { should have_css(".js-note-preview-button", visible: false) } |
47 | - within(".js-main-target-form") { should have_css(".js-note-edit-button", visible: true) } | |
47 | + within(".js-main-target-form") { should have_css(".js-note-write-button", visible: true) } | |
48 | 48 | end |
49 | 49 | end |
50 | 50 | end | ... | ... |
spec/features/security/project/internal_access_spec.rb
... | ... | @@ -190,17 +190,6 @@ describe "Internal Project Access", feature: true do |
190 | 190 | it { should be_denied_for :visitor } |
191 | 191 | end |
192 | 192 | |
193 | - describe "GET /:project_path/branches/recent" do | |
194 | - subject { recent_project_branches_path(project) } | |
195 | - | |
196 | - it { should be_allowed_for master } | |
197 | - it { should be_allowed_for reporter } | |
198 | - it { should be_allowed_for :admin } | |
199 | - it { should be_allowed_for guest } | |
200 | - it { should be_allowed_for :user } | |
201 | - it { should be_denied_for :visitor } | |
202 | - end | |
203 | - | |
204 | 193 | describe "GET /:project_path/branches" do |
205 | 194 | subject { project_branches_path(project) } |
206 | 195 | ... | ... |
spec/features/security/project/private_access_spec.rb
... | ... | @@ -168,17 +168,6 @@ describe "Private Project Access", feature: true do |
168 | 168 | it { should be_denied_for :visitor } |
169 | 169 | end |
170 | 170 | |
171 | - describe "GET /:project_path/branches/recent" do | |
172 | - subject { recent_project_branches_path(project) } | |
173 | - | |
174 | - it { should be_allowed_for master } | |
175 | - it { should be_allowed_for reporter } | |
176 | - it { should be_allowed_for :admin } | |
177 | - it { should be_denied_for guest } | |
178 | - it { should be_denied_for :user } | |
179 | - it { should be_denied_for :visitor } | |
180 | - end | |
181 | - | |
182 | 171 | describe "GET /:project_path/branches" do |
183 | 172 | subject { project_branches_path(project) } |
184 | 173 | ... | ... |
spec/features/security/project/public_access_spec.rb
... | ... | @@ -195,17 +195,6 @@ describe "Public Project Access", feature: true do |
195 | 195 | it { should be_denied_for :visitor } |
196 | 196 | end |
197 | 197 | |
198 | - describe "GET /:project_path/branches/recent" do | |
199 | - subject { recent_project_branches_path(project) } | |
200 | - | |
201 | - it { should be_allowed_for master } | |
202 | - it { should be_allowed_for reporter } | |
203 | - it { should be_allowed_for :admin } | |
204 | - it { should be_allowed_for guest } | |
205 | - it { should be_allowed_for :user } | |
206 | - it { should be_allowed_for :visitor } | |
207 | - end | |
208 | - | |
209 | 198 | describe "GET /:project_path/branches" do |
210 | 199 | subject { project_branches_path(project) } |
211 | 200 | ... | ... |