summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorazul <azul@leap.se>2015-09-30 10:51:21 +0200
committerazul <azul@leap.se>2015-09-30 10:51:21 +0200
commitd45f6c61f6a13be06f1977b857e0cb31e79c5317 (patch)
treed3089b334c2663ea2fd76cf62dea853bdd57b047 /engines
parenta894966e425f27c31e7da196658c6ddee3fc3714 (diff)
parentd4f10a8d47572bcab4c44878b952146732d64d2e (diff)
Merge pull request #194 from Alster-Hamburgers/feature/invite_code
Request for feedback on invite code feature
Diffstat (limited to 'engines')
-rw-r--r--engines/billing/test/functional/customers_controller_test.rb1
-rw-r--r--engines/support/test/integration/create_ticket_test.rb9
-rw-r--r--engines/support/test/unit/account_extension_test.rb4
-rw-r--r--engines/support/test/unit/ticket_test.rb4
4 files changed, 16 insertions, 2 deletions
diff --git a/engines/billing/test/functional/customers_controller_test.rb b/engines/billing/test/functional/customers_controller_test.rb
index cc82fc1..4d84fb0 100644
--- a/engines/billing/test/functional/customers_controller_test.rb
+++ b/engines/billing/test/functional/customers_controller_test.rb
@@ -5,6 +5,7 @@ class CustomersControllerTest < ActionController::TestCase
tests CustomerController
setup do
+ InviteCodeValidator.any_instance.stubs(:validate)
@user = FactoryGirl.create :user
@other_user = FactoryGirl.create :user
#FakeBraintree.clear!
diff --git a/engines/support/test/integration/create_ticket_test.rb b/engines/support/test/integration/create_ticket_test.rb
index 90e9a8a..00f9a6b 100644
--- a/engines/support/test/integration/create_ticket_test.rb
+++ b/engines/support/test/integration/create_ticket_test.rb
@@ -2,6 +2,11 @@ require 'test_helper'
class CreateTicketTest < BrowserIntegrationTest
+ setup do
+ @testcode = InviteCode.new
+ @testcode.save!
+ end
+
test "can submit ticket anonymously" do
visit '/'
click_on 'Get Help'
@@ -29,7 +34,7 @@ class CreateTicketTest < BrowserIntegrationTest
end
test "prefills fields" do
- login FactoryGirl.create(:premium_user)
+ login FactoryGirl.create(:premium_user, :invite_code => @testcode.invite_code)
visit '/'
click_on "Support Tickets"
click_on "New Ticket"
@@ -48,7 +53,7 @@ class CreateTicketTest < BrowserIntegrationTest
end
test "cleared email field should remain clear" do
- login FactoryGirl.create(:premium_user)
+ login FactoryGirl.create(:premium_user, :invite_code => @testcode.invite_code)
visit '/'
click_on "Support Tickets"
click_on "New Ticket"
diff --git a/engines/support/test/unit/account_extension_test.rb b/engines/support/test/unit/account_extension_test.rb
index aba162c..0ecb1aa 100644
--- a/engines/support/test/unit/account_extension_test.rb
+++ b/engines/support/test/unit/account_extension_test.rb
@@ -2,6 +2,10 @@ require 'test_helper'
class AccountExtensionTest < ActiveSupport::TestCase
+ setup do
+ InviteCodeValidator.any_instance.stubs(:validate)
+ end
+
test "destroying an account triggers ticket destruction" do
t = FactoryGirl.create :ticket_with_creator
u = t.created_by_user
diff --git a/engines/support/test/unit/ticket_test.rb b/engines/support/test/unit/ticket_test.rb
index c64e8f4..7b5281f 100644
--- a/engines/support/test/unit/ticket_test.rb
+++ b/engines/support/test/unit/ticket_test.rb
@@ -2,6 +2,10 @@ require 'test_helper'
class TicketTest < ActiveSupport::TestCase
+ setup do
+ InviteCodeValidator.any_instance.stubs(:validate)
+ end
+
test "ticket with default attribs is valid" do
t = FactoryGirl.build :ticket
assert t.valid?