From d620fd42925f1d3d29a66bb61a75bed8c2bdaf8f Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 6 Nov 2013 10:40:32 +0100 Subject: refactor: split up and cleaned up ticket validation tests --- help/test/factories.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'help/test/factories.rb') diff --git a/help/test/factories.rb b/help/test/factories.rb index 5b38952..5368ce6 100644 --- a/help/test/factories.rb +++ b/help/test/factories.rb @@ -2,8 +2,12 @@ FactoryGirl.define do factory :ticket do title { Faker::Lorem.sentence } - comments_attributes do - { "0" => { "body" => Faker::Lorem.sentences.join(" ") } } + email { Faker::Internet.email } + + factory :ticket_with_comment do + comments_attributes do + { "0" => { "body" => Faker::Lorem.sentences.join(" ") } } + end end end -- cgit v1.2.3 From ebc60f3aba1ca08e454ba5e91f49905df2e5fa13 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 6 Nov 2013 10:55:25 +0100 Subject: Ticket.destroy_all_from(user) - remove all tickets created by a user We'll use this to clean up after user destruction --- help/test/factories.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'help/test/factories.rb') diff --git a/help/test/factories.rb b/help/test/factories.rb index 5368ce6..bce3af1 100644 --- a/help/test/factories.rb +++ b/help/test/factories.rb @@ -9,6 +9,10 @@ FactoryGirl.define do { "0" => { "body" => Faker::Lorem.sentences.join(" ") } } end end + + factory :ticket_with_creator do + created_by { FactoryGirl.create(:user).id } + end end end -- cgit v1.2.3 From 3104677b8d96cd4a118022267abc7bed818f8ddd Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 11 Nov 2013 16:02:35 -0800 Subject: Rename ticket title to be subject, as that is what we are displaying it as. --- help/test/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'help/test/factories.rb') diff --git a/help/test/factories.rb b/help/test/factories.rb index bce3af1..be04f15 100644 --- a/help/test/factories.rb +++ b/help/test/factories.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :ticket do - title { Faker::Lorem.sentence } + subject { Faker::Lorem.sentence } email { Faker::Internet.email } factory :ticket_with_comment do -- cgit v1.2.3