refinerycms 0.9.7.7 → 0.9.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -3
- data/Gemfile +11 -7
- data/Rakefile +1 -1
- data/bin/refinerycms +10 -2
- data/changelog.md +11 -0
- data/config/amazon_s3.yml.example +2 -2
- data/config/cucumber.yml +3 -3
- data/config/environments/cucumber.rb +0 -4
- data/config/environments/production.rb +2 -2
- data/config/rackspace_cloudfiles.yml.example +10 -9
- data/features/refinery/dashboard.feature +1 -1
- data/features/step_definitions/refinery/core_steps.rb +51 -0
- data/features/step_definitions/web_steps.rb +0 -52
- data/features/support/env.rb +76 -52
- data/lib/gemspec.rb +1 -1
- data/lib/tasks/cucumber.rake +3 -3
- data/public/javascripts/jquery/jquery.html5-placeholder-shim.js +7 -2
- data/public/javascripts/refinery/admin.js +8 -3
- data/readme.md +30 -127
- data/todo.md +4 -11
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +1 -1
- data/vendor/plugins/attachment_fu/test/database.yml +2 -2
- data/vendor/plugins/authentication/app/views/admin/users/_form.html.erb +10 -3
- data/vendor/plugins/authentication/app/views/admin/users/_user.html.erb +2 -1
- data/vendor/plugins/authentication/config/locales/nb.yml +44 -44
- data/vendor/plugins/dashboard/config/locales/nb.yml +10 -7
- data/vendor/plugins/images/app/helpers/admin/images_helper.rb +1 -1
- data/vendor/plugins/images/app/views/admin/images/_form.html.erb +14 -7
- data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +2 -1
- data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +2 -1
- data/vendor/plugins/images/config/locales/da.yml +4 -6
- data/vendor/plugins/images/config/locales/de.yml +4 -6
- data/vendor/plugins/images/config/locales/en.yml +4 -6
- data/vendor/plugins/images/config/locales/es.yml +4 -6
- data/vendor/plugins/images/config/locales/fr.yml +4 -6
- data/vendor/plugins/images/config/locales/it.yml +4 -6
- data/vendor/plugins/images/config/locales/nb.yml +22 -19
- data/vendor/plugins/images/config/locales/nl.yml +4 -6
- data/vendor/plugins/images/config/locales/pt-BR.yml +4 -6
- data/vendor/plugins/images/config/locales/sl.yml +4 -6
- data/vendor/plugins/inquiries/config/locales/nb.yml +35 -25
- data/vendor/plugins/model_translations/test/model_translations_test.rb +1 -1
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +19 -4
- data/vendor/plugins/pages/config/locales/nb.yml +71 -29
- data/vendor/plugins/refinery/app/views/shared/_content_page.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +6 -4
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +1 -1
- data/vendor/plugins/refinery/config/locales/nb.yml +28 -31
- data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +1 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/config/locales/nb.yml +16 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +6 -1
- data/vendor/plugins/refinery/lib/refinery.rb +1 -1
- data/vendor/plugins/refinery/lib/tasks/refinery.rake +65 -7
- data/{lib/refinery → vendor/plugins/refinery/lib}/tasks/refinery.rb +2 -4
- data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +9 -0
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +3 -1
- data/vendor/plugins/refinery_settings/config/locales/nb.yml +31 -9
- data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +3 -1
- data/vendor/plugins/resources/config/locales/nb.yml +8 -7
- metadata +7 -6
- data/lib/refinery/tasks/refinery.rake +0 -59
data/.gitignore
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Rails
|
2
2
|
.bundle
|
3
3
|
db/*.sqlite3
|
4
|
-
log
|
4
|
+
*.log
|
5
5
|
tmp/**/*
|
6
6
|
|
7
7
|
# Documentation
|
@@ -56,8 +56,9 @@ tags
|
|
56
56
|
# Capybara Bug
|
57
57
|
capybara-*html
|
58
58
|
|
59
|
+
#===REMOVED DURING REFINERY GEM INSTALL===
|
59
60
|
# Development Specific
|
60
|
-
# REMOVE IF UPLOADING TO SERVER
|
61
61
|
config/database.yml
|
62
62
|
config/amazon_s3.yml
|
63
|
-
config/rackspace_cloudfiles.yml
|
63
|
+
config/rackspace_cloudfiles.yml
|
64
|
+
#===END OF REMOVED DURING REFINERY GEM INSTALL===
|
data/Gemfile
CHANGED
@@ -21,27 +21,31 @@ gem 'acts_as_indexed', '= 0.6.3', :require => 'acts_as_indexed'
|
|
21
21
|
gem 'authlogic', '= 2.1.5', :require => 'authlogic'
|
22
22
|
gem 'friendly_id', '= 3.0.6', :require => 'friendly_id'
|
23
23
|
gem 'rails', '= 2.3.8'
|
24
|
-
gem 'rmagick', '~> 2.12.
|
24
|
+
gem 'rmagick', '~> 2.12.0'
|
25
25
|
gem 'truncate_html', '= 0.3.2', :require => 'truncate_html'
|
26
26
|
gem 'will_paginate', '= 2.3.14', :require => 'will_paginate'
|
27
27
|
|
28
28
|
group :test do
|
29
29
|
gem 'json_pure', :require => 'json/pure', :git => 'git://github.com/parndt/json.git', :branch => 'master'
|
30
|
-
gem 'rspec'
|
31
|
-
gem 'rspec-rails'
|
32
30
|
gem 'factory_girl'
|
33
|
-
gem 'test-unit',
|
34
|
-
gem 'cucumber-rails'
|
31
|
+
gem 'test-unit', '= 1.2.3'
|
35
32
|
gem 'capybara'
|
36
|
-
gem 'factory_girl'
|
37
33
|
gem 'database_cleaner'
|
34
|
+
gem 'cucumber-rails'
|
35
|
+
gem 'cucumber'
|
36
|
+
gem 'rspec'
|
37
|
+
gem 'rspec-rails'
|
38
|
+
gem 'spork' unless RUBY_PLATFORM =~ /mswin|mingw/
|
38
39
|
gem 'launchy'
|
40
|
+
gem 'gherkin'
|
41
|
+
gem 'factory_girl'
|
42
|
+
gem 'ruby-prof'
|
39
43
|
end
|
40
44
|
#===REFINERY END OF REQUIRED GEMS===
|
41
45
|
|
42
46
|
#===REQUIRED FOR REFINERY GEM INSTALL===
|
43
47
|
# Leave the gem below disabled (commented out) if you're not using the gem install method.
|
44
|
-
# gem 'refinerycms', '= 0.9.7.
|
48
|
+
# gem 'refinerycms', '= 0.9.7.8'
|
45
49
|
#===END OF REFINERY GEM INSTALL REQUIREMENTS===
|
46
50
|
|
47
51
|
# Bundle gems for certain environments:
|
data/Rakefile
CHANGED
data/bin/refinerycms
CHANGED
@@ -34,7 +34,7 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
|
|
34
34
|
FileUtils::makedirs rails_root
|
35
35
|
|
36
36
|
# copy in all of the relevant directories and root files.
|
37
|
-
to_copy = %w(app config db lib public themes script *.md Rakefile
|
37
|
+
to_copy = %w(app config db lib public themes script *.md Rakefile config.ru).map do |dir|
|
38
38
|
(new_file_path = refinery_root.join(dir)).exist? ? new_file_path.to_s : nil
|
39
39
|
end
|
40
40
|
FileUtils::cp_r to_copy.compact, rails_root, :verbose => false
|
@@ -113,12 +113,20 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
|
|
113
113
|
app_gemfile.puts(lines.join("\n"))
|
114
114
|
app_gemfile.close
|
115
115
|
|
116
|
+
# Remove development specific stuff from the .gitinore file
|
117
|
+
ignore_content = refinery_root.join('.gitignore').read
|
118
|
+
ignore_content.gsub!(/#===REMOVED DURING REFINERY GEM INSTALL===.*#===END OF REMOVED DURING REFINERY GEM INSTALL===/m, '')
|
119
|
+
|
120
|
+
File.open(File.join(%W(#{rails_root} .gitignore)), "w") do |f|
|
121
|
+
f.puts(ignore_content)
|
122
|
+
end
|
123
|
+
|
116
124
|
puts "\n---------"
|
117
125
|
puts "Refinery successfully installed in '#{rails_root}'!\n\n"
|
118
126
|
|
119
127
|
# automate..
|
120
128
|
puts "Installing gem requirements using bundler..\n"
|
121
|
-
puts "Running: " + (cmd="bundle install
|
129
|
+
puts "Running: " + (cmd="bundle install")
|
122
130
|
puts `cd '#{rails_root}' && #{cmd}`
|
123
131
|
|
124
132
|
puts "\n\nSetting up your development database..\n"
|
data/changelog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 0.9.7.8 [23 July 2010]
|
2
|
+
|
3
|
+
- Refactored Amazon S3 and gem installation to make it easier to install on Heroku. [Steven Heidel](http://github.com/stevenheidel)
|
4
|
+
- Made project more testable. Renamed rake refinery:test_all to rake test:refinery [Philip Arndt](http://github.com/parndt)
|
5
|
+
- Documentation improved [David Jones](http://github.com/djones), [Philip Arndt](http://github.com/parndt) and [Steven Heidel](http://github.com/stevenheidel)
|
6
|
+
- Installed spork for use with systems that support forking for performance improvements. Doesn't run on Windows. [Philip Arndt](http://github.com/parndt) and [James Fiderlick](http://github.com/jamesfid)
|
7
|
+
- Improvements and new translations for Norsk Bokmål localisation. [Ken Paulsen](http://github.com/ken-guru)
|
8
|
+
- Ensured that RefinerySetting restrictions work properly using a before_save handler. [Joe Sak](http://github.com/joemsak)
|
9
|
+
- Updated jquery-html5-placeholder-shim to latest version. [Amanda Wagener](http://github.com/awagener)
|
10
|
+
- [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.7...0.9.7.8)
|
11
|
+
|
1
12
|
## 0.9.7.7 [20 July 2010]
|
2
13
|
|
3
14
|
- Fixed an issue in the plugin generator that saw locales being created with singular_name not the interpreted version. [Philip Arndt](http://github.com/parndt) and [Joe Sak](http://github.com/joemsak)
|
data/config/cucumber.yml
CHANGED
@@ -3,6 +3,6 @@ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
|
3
3
|
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
4
|
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
5
5
|
%>
|
6
|
-
default: <%= std_opts %> features
|
7
|
-
wip: --tags @wip:3 --wip features
|
8
|
-
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
6
|
+
default: --drb <%= std_opts %> features
|
7
|
+
wip: --drb --tags @wip:3 --wip features
|
8
|
+
rerun: --drb <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -21,7 +21,3 @@ config.action_controller.allow_forgery_protection = false
|
|
21
21
|
# ActionMailer::Base.deliveries array.
|
22
22
|
config.action_mailer.delivery_method = :test
|
23
23
|
|
24
|
-
config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.2' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
|
25
|
-
config.gem 'database_cleaner', :lib => false, :version => '>=0.5.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
|
26
|
-
config.gem 'capybara', :lib => false, :version => '>=0.3.5' unless File.directory?(File.join(Rails.root, 'vendor/plugins/capybara'))
|
27
|
-
|
@@ -21,7 +21,7 @@ config.action_controller.perform_caching = true
|
|
21
21
|
# is going on but without being chatty and therefore slow.
|
22
22
|
config.log_level = :info
|
23
23
|
|
24
|
-
#
|
24
|
+
# When true will use Amazon's Simple Storage Service on your production machine
|
25
25
|
# instead of the default file system for resources and images
|
26
26
|
# Make sure to your bucket info is correct in amazon_s3.yml
|
27
|
-
Refinery.s3_backend =
|
27
|
+
Refinery.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)
|
@@ -1,14 +1,15 @@
|
|
1
|
+
login: &login
|
2
|
+
username: <%= ENV['RACKSPACE_USERNAME'] %>
|
3
|
+
api_key: <%= ENV['RACKSPACE_KEY'] %>
|
4
|
+
|
1
5
|
development:
|
2
|
-
|
3
|
-
|
4
|
-
api_key:
|
6
|
+
container_name: your_local_rackspace_cloudfiles
|
7
|
+
<<: *login
|
5
8
|
|
6
9
|
test:
|
7
|
-
|
8
|
-
|
9
|
-
api_key:
|
10
|
+
container_name: your_test_rackspace_cloudfiles
|
11
|
+
<<: *login
|
10
12
|
|
11
13
|
production:
|
12
|
-
|
13
|
-
|
14
|
-
api_key:
|
14
|
+
container_name: your_production_rackspace_cloudfiles
|
15
|
+
<<: *login
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Login stuff
|
2
|
+
Given %r`not logged in$` do
|
3
|
+
visit logout_path
|
4
|
+
end
|
5
|
+
|
6
|
+
Given %r`(?:log|am logged) in as "([^\"]+)"$` do |login|
|
7
|
+
@my_username = login
|
8
|
+
visit login_path
|
9
|
+
And %Q`enter the username "#{login}"`
|
10
|
+
And %Q`enter the password "#{login}-123"`
|
11
|
+
And "press the login button"
|
12
|
+
end
|
13
|
+
|
14
|
+
Then 'I should( not)? see a login form' do |negative|
|
15
|
+
expect_opposite_if(negative) do
|
16
|
+
response.should have_tag('form#new_user_session') do
|
17
|
+
field_labeled('Username').should_not be_nil
|
18
|
+
field_labeled('Password', :password).should_not be_nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
When %r`enter the username "(.+)"$` do |login|
|
24
|
+
fill_in 'user_session[login]' , :with => login
|
25
|
+
end
|
26
|
+
|
27
|
+
When %r`enter the password "(.+)-123"$` do |login|
|
28
|
+
fill_in 'user_session[password]', :with => "#{login}-123"
|
29
|
+
end
|
30
|
+
|
31
|
+
When %r`press the login button$` do
|
32
|
+
click_button 'Sign In'
|
33
|
+
end
|
34
|
+
|
35
|
+
Then %r`not be allowed to log in$` do
|
36
|
+
When %Q`log in as "#{@my_username}"`
|
37
|
+
Then 'I should see a login form'
|
38
|
+
end
|
39
|
+
|
40
|
+
Then %r`be redirected to login$` do
|
41
|
+
request.request_uri.should == login_path
|
42
|
+
end
|
43
|
+
|
44
|
+
Then /^"([^\"]*)" can log in$/ do |name|
|
45
|
+
user = User.find_by_login!(name)
|
46
|
+
visit login_path
|
47
|
+
When %Q`I enter the username "#{name}"`
|
48
|
+
And %Q`I enter the password "#{name}-123"`
|
49
|
+
And 'I press the login button'
|
50
|
+
Then 'I should not see a login form'
|
51
|
+
end
|
@@ -217,55 +217,3 @@ end
|
|
217
217
|
Then /^show me the page$/ do
|
218
218
|
save_and_open_page
|
219
219
|
end
|
220
|
-
|
221
|
-
# Login stuff
|
222
|
-
Given %r`not logged in$` do
|
223
|
-
visit logout_path
|
224
|
-
end
|
225
|
-
|
226
|
-
Given %r`(?:log|am logged) in as "([^\"]+)"$` do |login|
|
227
|
-
@my_username = login
|
228
|
-
visit login_path
|
229
|
-
And %Q`enter the username "#{login}"`
|
230
|
-
And %Q`enter the password "#{login}-123"`
|
231
|
-
And "press the login button"
|
232
|
-
end
|
233
|
-
|
234
|
-
Then 'I should( not)? see a login form' do |negative|
|
235
|
-
expect_opposite_if(negative) do
|
236
|
-
response.should have_tag('form#new_user_session') do
|
237
|
-
field_labeled('Username').should_not be_nil
|
238
|
-
field_labeled('Password', :password).should_not be_nil
|
239
|
-
end
|
240
|
-
end
|
241
|
-
end
|
242
|
-
|
243
|
-
When %r`enter the username "(.+)"$` do |login|
|
244
|
-
fill_in 'user_session[login]' , :with => login
|
245
|
-
end
|
246
|
-
|
247
|
-
When %r`enter the password "(.+)-123"$` do |login|
|
248
|
-
fill_in 'user_session[password]', :with => "#{login}-123"
|
249
|
-
end
|
250
|
-
|
251
|
-
When %r`press the login button$` do
|
252
|
-
click_button 'Sign In'
|
253
|
-
end
|
254
|
-
|
255
|
-
Then %r`not be allowed to log in$` do
|
256
|
-
When %Q`log in as "#{@my_username}"`
|
257
|
-
Then 'I should see a login form'
|
258
|
-
end
|
259
|
-
|
260
|
-
Then %r`be redirected to login$` do
|
261
|
-
request.request_uri.should == login_path
|
262
|
-
end
|
263
|
-
|
264
|
-
Then /^"([^\"]*)" can log in$/ do |name|
|
265
|
-
user = User.find_by_login!(name)
|
266
|
-
visit login_path
|
267
|
-
When %Q`I enter the username "#{name}"`
|
268
|
-
And %Q`I enter the password "#{name}-123"`
|
269
|
-
And 'I press the login button'
|
270
|
-
Then 'I should not see a login form'
|
271
|
-
end
|
data/features/support/env.rb
CHANGED
@@ -4,60 +4,84 @@
|
|
4
4
|
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
5
|
# files.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require '
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
require '
|
16
|
-
require 'capybara/cucumber'
|
17
|
-
require 'capybara/session'
|
18
|
-
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
19
|
-
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
20
|
-
# order to ease the transition to Capybara we set the default here. If you'd
|
21
|
-
# prefer to use XPath just remove this line and adjust any selectors in your
|
22
|
-
# steps to use the XPath syntax.
|
23
|
-
Capybara.default_selector = :css
|
24
|
-
|
25
|
-
# If you set this to false, any error raised from within your app will bubble
|
26
|
-
# up to your step definition and out to cucumber unless you catch it somewhere
|
27
|
-
# on the way. You can make Rails rescue errors and render error pages on a
|
28
|
-
# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
|
29
|
-
#
|
30
|
-
# If you set this to true, Rails will rescue all errors and render error
|
31
|
-
# pages, more or less in the same way your application would behave in the
|
32
|
-
# default production environment. It's not recommended to do this for all
|
33
|
-
# of your scenarios, as this makes it hard to discover errors in your application.
|
34
|
-
ActionController::Base.allow_rescue = false
|
35
|
-
|
36
|
-
# If you set this to true, each scenario will run in a database transaction.
|
37
|
-
# You can still turn off transactions on a per-scenario basis, simply tagging
|
38
|
-
# a feature or scenario with the @no-txn tag. If you are using Capybara,
|
39
|
-
# tagging with @culerity or @javascript will also turn transactions off.
|
40
|
-
#
|
41
|
-
# If you set this to false, transactions will be off for all scenarios,
|
42
|
-
# regardless of whether you use @no-txn or not.
|
43
|
-
#
|
44
|
-
# Beware that turning transactions off will leave data in your database
|
45
|
-
# after each scenario, which can lead to hard-to-debug failures in
|
46
|
-
# subsequent scenarios. If you do this, we recommend you create a Before
|
47
|
-
# block that will explicitly put your database in a known state.
|
48
|
-
Cucumber::Rails::World.use_transactional_fixtures = true
|
49
|
-
# How to clean your database when transactions are turned off. See
|
50
|
-
# http://github.com/bmabey/database_cleaner for more info.
|
51
|
-
if defined?(ActiveRecord::Base)
|
52
|
-
begin
|
53
|
-
require 'database_cleaner'
|
54
|
-
DatabaseCleaner.strategy = :truncation
|
55
|
-
rescue LoadError => ignore_if_database_cleaner_not_present
|
7
|
+
## This is custom functionality written by Refinery CMS.
|
8
|
+
def setup_environment
|
9
|
+
ENV["RAILS_ENV"] ||= "cucumber"
|
10
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
11
|
+
|
12
|
+
if RUBY_PLATFORM =~ /mswin/
|
13
|
+
puts "Win32 users may experience cucumber/formatter/unicode errors. Requirement ommited, see: /features/support/env.rb to re-add."
|
14
|
+
else
|
15
|
+
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
|
56
16
|
end
|
17
|
+
require 'cucumber/rails/world'
|
18
|
+
require 'cucumber/rails/active_record'
|
19
|
+
require 'cucumber/web/tableish'
|
20
|
+
|
21
|
+
|
22
|
+
require 'capybara/rails'
|
23
|
+
require 'capybara/cucumber'
|
24
|
+
require 'capybara/session'
|
25
|
+
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
26
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
27
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
28
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
29
|
+
# steps to use the XPath syntax.
|
30
|
+
Capybara.default_selector = :css
|
57
31
|
end
|
58
32
|
|
59
|
-
|
60
|
-
|
61
|
-
|
33
|
+
def each_run
|
34
|
+
# If you set this to false, any error raised from within your app will bubble
|
35
|
+
# up to your step definition and out to cucumber unless you catch it somewhere
|
36
|
+
# on the way. You can make Rails rescue errors and render error pages on a
|
37
|
+
# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
|
38
|
+
#
|
39
|
+
# If you set this to true, Rails will rescue all errors and render error
|
40
|
+
# pages, more or less in the same way your application would behave in the
|
41
|
+
# default production environment. It's not recommended to do this for all
|
42
|
+
# of your scenarios, as this makes it hard to discover errors in your application.
|
43
|
+
ActionController::Base.allow_rescue = false
|
44
|
+
|
45
|
+
# If you set this to true, each scenario will run in a database transaction.
|
46
|
+
# You can still turn off transactions on a per-scenario basis, simply tagging
|
47
|
+
# a feature or scenario with the @no-txn tag. If you are using Capybara,
|
48
|
+
# tagging with @culerity or @javascript will also turn transactions off.
|
49
|
+
#
|
50
|
+
# If you set this to false, transactions will be off for all scenarios,
|
51
|
+
# regardless of whether you use @no-txn or not.
|
52
|
+
#
|
53
|
+
# Beware that turning transactions off will leave data in your database
|
54
|
+
# after each scenario, which can lead to hard-to-debug failures in
|
55
|
+
# subsequent scenarios. If you do this, we recommend you create a Before
|
56
|
+
# block that will explicitly put your database in a known state.
|
57
|
+
Cucumber::Rails::World.use_transactional_fixtures = true
|
58
|
+
# How to clean your database when transactions are turned off. See
|
59
|
+
# http://github.com/bmabey/database_cleaner for more info.
|
60
|
+
if defined?(ActiveRecord::Base)
|
61
|
+
begin
|
62
|
+
require 'database_cleaner'
|
63
|
+
DatabaseCleaner.strategy = :truncation
|
64
|
+
rescue LoadError => ignore_if_database_cleaner_not_present
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
require 'authlogic/test_case'
|
69
|
+
Before do
|
70
|
+
activate_authlogic
|
71
|
+
end
|
62
72
|
end
|
63
73
|
|
74
|
+
unless RUBY_PLATFORM =~ /mswin|mingw/
|
75
|
+
require 'spork'
|
76
|
+
|
77
|
+
Spork.prefork do
|
78
|
+
setup_environment
|
79
|
+
end
|
80
|
+
|
81
|
+
Spork.each_run do
|
82
|
+
each_run
|
83
|
+
end
|
84
|
+
else
|
85
|
+
setup_environment
|
86
|
+
each_run
|
87
|
+
end
|
data/lib/gemspec.rb
CHANGED
@@ -5,7 +5,7 @@ files = %w( .gitignore .yardopts Gemfile Rakefile *.md public/.htaccess config.r
|
|
5
5
|
files += Dir.glob("#{dir}/**/*")
|
6
6
|
end
|
7
7
|
|
8
|
-
files.reject!{|f| !File.exist?(f) or f =~ /^(public\/system)|(config\/database.yml$)|(.*\/cache)|(db\/.*\.sqlite3
|
8
|
+
files.reject!{|f| !File.exist?(f) or f =~ /^(public\/system)|(config\/database.yml$)|(.*\/cache)|(db\/.*\.sqlite3?$)|(\.log$)|(\.rbc$)/}
|
9
9
|
|
10
10
|
gemspec = <<EOF
|
11
11
|
Gem::Specification.new do |s|
|
data/lib/tasks/cucumber.rake
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
-
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
-
# newer version of cucumber-rails. Consider adding your own code to a new file
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
4
|
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
5
|
# files.
|
6
6
|
|
7
7
|
|
8
8
|
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
9
9
|
|
10
|
-
vendored_cucumber_bin = Dir[
|
10
|
+
vendored_cucumber_bin = Dir[Rails.root.join('vendor', '{gems,plugins}', 'cucumber*', 'bin', 'cucumber').to_s].first
|
11
11
|
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
12
12
|
|
13
13
|
begin
|