Show 'api offline' message on new note page
This commit is contained in:
parent
86fae8980d
commit
ca4ee6faa9
4 changed files with 36 additions and 1 deletions
23
test/system/create_note_test.rb
Normal file
23
test/system/create_note_test.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class CreateNoteTest < ApplicationSystemTestCase
|
||||
test "can create note" do
|
||||
visit new_note_path(:anchor => "map=18/0/0")
|
||||
|
||||
assert_button "Add Note", :disabled => true
|
||||
|
||||
fill_in "text", :with => "Some newly added note description"
|
||||
click_on "Add Note"
|
||||
|
||||
assert_content "Unresolved note ##{Note.last.id}"
|
||||
assert_content "Some newly added note description"
|
||||
end
|
||||
|
||||
test "cannot create note when api is readonly" do
|
||||
with_settings(:status => "api_readonly") do
|
||||
visit new_note_path(:anchor => "map=18/0/0")
|
||||
|
||||
assert_no_button "Add Note", :disabled => true
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue