From 065859b90cc5ef403b8f47bd5394b343e556cc4d Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 23 Mar 2016 21:48:52 +0100 Subject: upgrade: remove references to RestClient CouchRest > 1.2 does not use RestClient anymore. So we should not try to catch its errors. --- engines/support/test/unit/ticket_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/support/test') diff --git a/engines/support/test/unit/ticket_test.rb b/engines/support/test/unit/ticket_test.rb index 7b5281f..c2c5e11 100644 --- a/engines/support/test/unit/ticket_test.rb +++ b/engines/support/test/unit/ticket_test.rb @@ -63,7 +63,7 @@ class TicketTest < ActiveSupport::TestCase test "find tickets user commented on" do # clear old tickets just in case - # this will cause RestClient::ResourceNotFound errors if there are multiple copies of the same ticket returned + # this will cause RESOURCE_NOT_FOUND errors if there are multiple copies of the same ticket returned Ticket.by_includes_post_by.key('123').each {|t| t.destroy} # TODO: the by_includes_post_by view is only used for tests. Maybe we should get rid of it and change the test to including ordering? -- cgit v1.2.3 From a1b494e334406660a1f49fb7de9b043493809640 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 13 May 2016 16:23:10 +0200 Subject: ensure invalid user ids still render the ticket form We still have strange urls requested like /pt/users/AnonymousUser.../tickets/new Not sure where they are coming from - but this should make sure we respond with sth. meaningful instead of erroring out. Conflicts: app/views/layouts/_content.html.haml --- engines/support/test/functional/tickets_controller_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/support/test') diff --git a/engines/support/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb index a7a2011..5c2b346 100644 --- a/engines/support/test/functional/tickets_controller_test.rb +++ b/engines/support/test/functional/tickets_controller_test.rb @@ -35,6 +35,12 @@ class TicketsControllerTest < ActionController::TestCase assert_response :success end + test "should get new despite invalid user_id" do + get :new, user_id: :bla + assert_equal Ticket, assigns(:ticket).class + assert_response :success + end + test "unauthenticated tickets are visible" do ticket = find_record :ticket, :created_by => nil get :show, :id => ticket.id -- cgit v1.2.3 From f20ecdfb249128ba79da069407dce32f6f7e2fca Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 20 May 2016 11:47:38 +0200 Subject: include engine tests in default test --- engines/support/test/integration/create_ticket_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/support/test') diff --git a/engines/support/test/integration/create_ticket_test.rb b/engines/support/test/integration/create_ticket_test.rb index 00f9a6b..6abb3d3 100644 --- a/engines/support/test/integration/create_ticket_test.rb +++ b/engines/support/test/integration/create_ticket_test.rb @@ -29,7 +29,7 @@ class CreateTicketTest < BrowserIntegrationTest fill_in 'Description', with: 'description of the problem goes here' click_on 'Submit Ticket' assert page.has_content?("is invalid") - assert_equal 'invalid data', find_field('Email').value + assert_equal 'invaliddata', find_field('Email').value assert_equal 'some user', find_field('Regarding User').value end -- cgit v1.2.3 From b851fe2fd6e0029df81976b647ede7190a1fd547 Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 22 May 2016 21:11:48 +0200 Subject: make ticket tests pass without network connection MX validations relied on network connection. Only using them in production environment now. I want to be able to develop and test when disconnected. --- engines/support/test/unit/ticket_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/support/test') diff --git a/engines/support/test/unit/ticket_test.rb b/engines/support/test/unit/ticket_test.rb index c2c5e11..373f06c 100644 --- a/engines/support/test/unit/ticket_test.rb +++ b/engines/support/test/unit/ticket_test.rb @@ -8,12 +8,12 @@ class TicketTest < ActiveSupport::TestCase test "ticket with default attribs is valid" do t = FactoryGirl.build :ticket - assert t.valid? + assert t.valid?, t.errors.full_messages.to_sentence end test "ticket without email is valid" do t = FactoryGirl.build :ticket, email: "" - assert t.valid? + assert t.valid?, t.errors.full_messages.to_sentence end test "ticket validates email format" do -- cgit v1.2.3