mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-16 22:25:28 +01:00
use state machine from controller and handle exception
This commit is contained in:
parent
004339a2ca
commit
2719cb87c7
3 changed files with 54 additions and 33 deletions
|
|
@ -31,7 +31,16 @@ class ContextsControllerTest < ActionController::TestCase
|
|||
assert_ajax_create_increments_count '@newcontext'
|
||||
end
|
||||
|
||||
# text feed
|
||||
def test_update_handles_invalid_state_change
|
||||
login_as :admin_user
|
||||
context = users(:admin_user).contexts.first
|
||||
xhr :put, :update, :id => context.id, :context => {:name => "@name", :state => 'closed'}
|
||||
|
||||
assert_response 200
|
||||
assert /The context cannot be closed if you have uncompleted actions/.match(@response.body)
|
||||
end
|
||||
|
||||
# TXT feed
|
||||
|
||||
def test_text_feed_content
|
||||
login_as :admin_user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue