From d6d4b6bee4eae99dd7130fa187ed3ddb3850c2de Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 4 Feb 2019 17:43:56 +0100 Subject: [PATCH] Fixed test results with new rspec factories behaviour (now groups will have email addresses which will generate auto responder per default now). --- spec/requests/ticket/article_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/requests/ticket/article_spec.rb b/spec/requests/ticket/article_spec.rb index 7a6e1db1b..f09aa4055 100644 --- a/spec/requests/ticket/article_spec.rb +++ b/spec/requests/ticket/article_spec.rb @@ -282,7 +282,9 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO expect(json_response).to be_a_kind_of(Hash) expect(json_response['title']).to eq('a new ticket #1') - article = Ticket::Article.find_by(ticket_id: json_response['id']) + expect(Ticket::Article.where(ticket_id: json_response['id']).count).to eq(2) # original + auto responder + + article = Ticket::Article.where(ticket_id: json_response['id']).first expect(article.origin_by_id).to eq(customer_user.id) expect(article.from).to eq("#{customer_user.firstname} #{customer_user.lastname} <#{customer_user.email}>") end @@ -304,7 +306,9 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO expect(response).to have_http_status(201) expect(json_response).to be_a_kind_of(Hash) - article = Ticket::Article.find_by(ticket_id: json_response['id']) + expect(Ticket::Article.where(ticket_id: json_response['id']).count).to eq(1) # ony original + + article = Ticket::Article.where(ticket_id: json_response['id']).first expect(article.origin_by_id).to eq(customer_user.id) end