Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 75 lines (66 sloc) 2.008 kb
80781ac Sean Cribbs Import from old repository.
seancribbs authored
1 unless defined? SPEC_ROOT
2 ENV["RAILS_ENV"] = "test"
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
3
80781ac Sean Cribbs Import from old repository.
seancribbs authored
4 SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
5
80781ac Sean Cribbs Import from old repository.
seancribbs authored
6 unless defined? RADIANT_ROOT
7 if env_file = ENV["RADIANT_ENV_FILE"]
8 require env_file
9 else
10 require File.expand_path(SPEC_ROOT + "/../config/environment")
11 end
12 end
13 require 'spec'
14 require 'spec/rails'
1b9442d Nathaniel Talbott Moved to dataset.
ntalbott authored
15 require 'dataset'
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
16 # require 'spec/integration'
17
894bc73 Adam Williams Removed unprocessible_entity status for validation errors when html form...
aiwilliams authored
18 module Kernel
19 def rputs(*args)
20 puts *["<pre>", args.collect {|a| CGI.escapeHTML(a.inspect)}, "</pre>"]
21 end
22 end
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
23
80781ac Sean Cribbs Import from old repository.
seancribbs authored
24 class Test::Unit::TestCase
1b9442d Nathaniel Talbott Moved to dataset.
ntalbott authored
25 include Dataset
26 datasets_directory "#{RADIANT_ROOT}/spec/datasets"
3c52021 Sean Cribbs Update dataset, spec_integration, and vizres plugins.
seancribbs authored
27 Dataset::ContextClassMethods.datasets_database_dump_path = File.expand_path(RAILS_ROOT + '/tmp/dataset')
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
28
80781ac Sean Cribbs Import from old repository.
seancribbs authored
29 class << self
30 # Class method for test helpers
31 def test_helper(*names)
32 names.each do |name|
33 name = name.to_s
34 name = $1 if name =~ /^(.*?)_test_helper$/i
35 name = name.singularize
36 first_time = true
37 begin
38 constant = (name.camelize + 'TestHelper').constantize
39 self.class_eval { include constant }
40 rescue NameError
41 filename = File.expand_path(SPEC_ROOT + '/../test/helpers/' + name + '_test_helper.rb')
42 require filename if first_time
43 first_time = false
44 retry
45 end
46 end
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
47 end
80781ac Sean Cribbs Import from old repository.
seancribbs authored
48 alias :test_helpers :test_helper
49 end
50 end
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
51
80781ac Sean Cribbs Import from old repository.
seancribbs authored
52 Dir[RADIANT_ROOT + '/spec/matchers/*_matcher.rb'].each do |matcher|
53 require matcher
54 end
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
55
35881a9 Adam Williams Integration spec support, a couple of tests for login and snippets.
aiwilliams authored
56 module Spec
57 module Application
3dc967d Adam Williams Removed lots of unused /test assets
aiwilliams authored
58 module ExampleExtensions
59 def rails_log
60 log = IO.read(RAILS_ROOT + '/log/test.log')
61 log.should_not be_nil
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
62 log
e5f0e6e Adam Williams Renamed snippet controller to snippets
aiwilliams authored
63 end
35881a9 Adam Williams Integration spec support, a couple of tests for login and snippets.
aiwilliams authored
64 end
65 end
66 end
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
67
80781ac Sean Cribbs Import from old repository.
seancribbs authored
68 Spec::Runner.configure do |config|
3dc967d Adam Williams Removed lots of unused /test assets
aiwilliams authored
69 config.include Spec::Application::ExampleExtensions
c125dbf Sean Cribbs Convert integration specs to Cucumber stories and update RSpec.
seancribbs authored
70
80781ac Sean Cribbs Import from old repository.
seancribbs authored
71 config.use_transactional_fixtures = true
72 config.use_instantiated_fixtures = false
73 config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
74 end
75 end
Something went wrong with that request. Please try again.