]> git.openstreetmap.org Git - rails.git/blob - test/system/create_note_test.rb
Merge remote-tracking branch 'upstream/pull/5419'
[rails.git] / test / system / create_note_test.rb
1 require "application_system_test_case"
2
3 class CreateNoteTest < ApplicationSystemTestCase
4   test "can create note" do
5     visit new_note_path(:anchor => "map=18/0/0")
6
7     within_sidebar do
8       assert_button "Add Note", :disabled => true
9
10       fill_in "text", :with => "Some newly added note description"
11       click_on "Add Note"
12
13       assert_content "Unresolved note ##{Note.last.id}"
14       assert_content "Some newly added note description"
15     end
16   end
17
18   test "cannot create note when api is readonly" do
19     with_settings(:status => "api_readonly") do
20       visit new_note_path(:anchor => "map=18/0/0")
21
22       within_sidebar do
23         assert_no_button "Add Note", :disabled => true
24       end
25     end
26   end
27 end