Create restful invites controller and ajaxified the workflow.
This commit is contained in:
parent
5cf75ee32a
commit
178fba7b30
11 changed files with 89 additions and 52 deletions
20
test/functional/invites_controller_test.rb
Normal file
20
test/functional/invites_controller_test.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
require 'test_helper'
|
||||
|
||||
class InvitesControllerTest < ActionController::TestCase
|
||||
def test_new
|
||||
get :new
|
||||
assert_template 'new'
|
||||
end
|
||||
|
||||
def test_create_invalid
|
||||
Invite.any_instance.stubs(:valid?).returns(false)
|
||||
post :create
|
||||
assert_template 'new'
|
||||
end
|
||||
|
||||
def test_create_valid
|
||||
Invite.any_instance.stubs(:valid?).returns(true)
|
||||
post :create
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue