summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-05-22 14:24:22 -0700
committerelijah <elijah@riseup.net>2015-05-22 14:24:22 -0700
commit9d1c6d33645196df697f2733860d23f0bb39b1c4 (patch)
tree83e14157d85bfe2137c5b937c962c1f352986b8e
parent63871baf6061668b162972193c55b5a8f7490797 (diff)
fix failing test
-rw-r--r--engines/support/test/functional/ticket_comments_test.rb6
-rw-r--r--engines/support/test/test_helper.rb16
-rw-r--r--test/factories.rb4
3 files changed, 10 insertions, 16 deletions
diff --git a/engines/support/test/functional/ticket_comments_test.rb b/engines/support/test/functional/ticket_comments_test.rb
index 5cbe233..c6c143a 100644
--- a/engines/support/test/functional/ticket_comments_test.rb
+++ b/engines/support/test/functional/ticket_comments_test.rb
@@ -1,4 +1,4 @@
-require 'test_helper'
+require_relative '../test_helper'
class TicketsCommentsTest < ActionController::TestCase
tests TicketsController
@@ -67,9 +67,9 @@ class TicketsCommentsTest < ActionController::TestCase
test "admin add comment to authenticated ticket" do
-
- other_user = find_record :user
login :is_admin? => true
+ admin = find_record :user, @current_user
+ other_user = find_record :user
ticket = FactoryGirl.create :ticket, :created_by => other_user.id
diff --git a/engines/support/test/test_helper.rb b/engines/support/test/test_helper.rb
index 57cdd63..6c19721 100644
--- a/engines/support/test/test_helper.rb
+++ b/engines/support/test/test_helper.rb
@@ -1,14 +1,6 @@
-# Configure Rails Environment
-ENV["RAILS_ENV"] = "test"
-
-require "rails/test_help"
-
-Rails.backtrace_cleaner.remove_silencers!
-
-# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+require_relative "../../../test/test_helper"
# Load fixtures from the engine
-if ActiveSupport::TestCase.method_defined?(:fixture_path=)
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
-end
+#if ActiveSupport::TestCase.method_defined?(:fixture_path=)
+# ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+#end
diff --git a/test/factories.rb b/test/factories.rb
index e16c738..0734688 100644
--- a/test/factories.rb
+++ b/test/factories.rb
@@ -6,7 +6,9 @@ end
FactoryGirl.define do
factory :user do
- login { Faker::Internet.user_name }
+ # Faker::Internet.user_name alone was sometimes
+ # producing duplicate usernames.
+ login { Faker::Internet.user_name + '_' + SecureRandom.hex(4) }
password_verifier "1234ABCD"
password_salt "4321AB"