summaryrefslogtreecommitdiff
path: root/engines/support/test
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-13 17:21:08 +0200
committerAzul <azul@leap.se>2014-05-13 22:21:09 +0200
commit3278e474a32ef4926b1dab0d97ca4df1c59aa2a0 (patch)
treeeb75c222343b0dd152c1ee7d7d0016af4e4fbbe8 /engines/support/test
parentbbe9de73352b5aa937173b4158267f6a37e9ca5f (diff)
adjust tests to new config and method implementation
Ticket.is_creator_vlidated? now actually fetches the user from the db and returns false if it does not exist.
Diffstat (limited to 'engines/support/test')
-rw-r--r--engines/support/test/functional/tickets_controller_test.rb4
-rw-r--r--engines/support/test/unit/ticket_test.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb
index d746b59..fc4a6f8 100644
--- a/engines/support/test/functional/tickets_controller_test.rb
+++ b/engines/support/test/functional/tickets_controller_test.rb
@@ -85,7 +85,7 @@ class TicketsControllerTest < ActionController::TestCase
test "should create authenticated ticket" do
- params = {:subject => "auth ticket test subject", :comments_attributes => {"0" => {"body" =>"body of test ticket"}}}
+ params = {:subject => "auth ticket test subject",:email => "", :comments_attributes => {"0" => {"body" =>"body of test ticket"}}}
login
@@ -97,7 +97,7 @@ class TicketsControllerTest < ActionController::TestCase
assert_not_nil assigns(:ticket).created_by
assert_equal assigns(:ticket).created_by, @current_user.id
- assert_equal assigns(:ticket).email, @current_user.email_address
+ assert_equal "", assigns(:ticket).email
assert_equal 1, assigns(:ticket).comments.count
assert_not_nil assigns(:ticket).comments.first.posted_by
diff --git a/engines/support/test/unit/ticket_test.rb b/engines/support/test/unit/ticket_test.rb
index f5e6ea7..678d8dc 100644
--- a/engines/support/test/unit/ticket_test.rb
+++ b/engines/support/test/unit/ticket_test.rb
@@ -27,10 +27,10 @@ class TicketTest < ActiveSupport::TestCase
end
test "creation validated" do
+ user = FactoryGirl.create :user
@sample = Ticket.new
assert !@sample.is_creator_validated?
- #p current_user
- @sample.created_by = 22 #current_user
+ @sample.created_by = user.id
assert @sample.is_creator_validated?
end