Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
463644c8
Commit
463644c8
authored
Aug 13, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rspec to capybara-webkit. simplercov now use cucumber
parent
28ddc152
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
40 deletions
+24
-40
features/support/env.rb
features/support/env.rb
+4
-29
lib/tasks/dev/tests.rake
lib/tasks/dev/tests.rake
+10
-0
spec/monkeypatch.rb
spec/monkeypatch.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+9
-10
No files found.
features/support/env.rb
View file @
463644c8
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
require
'simplecov'
# It is recommended to regenerate this file in the future when you upgrade to a
SimpleCov
.
start
'rails'
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require
'cucumber/rails'
require
'cucumber/rails'
require
'webmock/cucumber'
require
'webmock/cucumber'
...
@@ -13,16 +10,12 @@ require Rails.root.join 'spec/factories'
...
@@ -13,16 +10,12 @@ require Rails.root.join 'spec/factories'
require
Rails
.
root
.
join
'spec/support/login'
require
Rails
.
root
.
join
'spec/support/login'
require
Rails
.
root
.
join
'spec/support/valid_commit'
require
Rails
.
root
.
join
'spec/support/valid_commit'
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara
.
default_selector
=
:css
Capybara
.
default_selector
=
:css
Capybara
.
javascript_driver
=
:webkit
Capybara
.
javascript_driver
=
:webkit
# By default, any exception happening in your Rails application will bubble up
# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will
# your application behaves in the production environment, where an error page will
# be rendered instead.
# be rendered instead.
#
#
# Sometimes we want to override this default behaviour and allow Rails to rescue
# Sometimes we want to override this default behaviour and allow Rails to rescue
...
@@ -45,22 +38,4 @@ rescue NameError
...
@@ -45,22 +38,4 @@ rescue NameError
raise
"You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
raise
"You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
end
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
# See the DatabaseCleaner documentation for details. Example:
#
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
# # { :except => [:widgets] } may not do what you expect here
# # as tCucumber::Rails::Database.javascript_strategy overrides
# # this setting.
# DatabaseCleaner.strategy = :truncation
# end
#
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
# DatabaseCleaner.strategy = :transaction
# end
#
# Possible values are :truncation and :transaction
# The :transaction strategy is faster, but might give you threading problems.
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
Cucumber
::
Rails
::
Database
.
javascript_strategy
=
:truncation
Cucumber
::
Rails
::
Database
.
javascript_strategy
=
:truncation
lib/tasks/dev/tests.rake
0 → 100644
View file @
463644c8
namespace
:dev
do
desc
"DEV | Run cucumber and rspec"
task
:tests
do
[
"cucumber"
,
"rspec spec"
].
each
do
|
cmd
|
puts
"Starting to run
#{
cmd
}
..."
system
(
"bundle exec
#{
cmd
}
"
)
raise
"
#{
cmd
}
failed!"
unless
$?
.
exitstatus
==
0
end
end
end
spec/monkeypatch.rb
View file @
463644c8
...
@@ -35,7 +35,7 @@ class UsersProject
...
@@ -35,7 +35,7 @@ class UsersProject
end
end
class
FakeSatellite
class
FakeSatellite
def
exists?
def
exists?
true
true
end
end
...
...
spec/spec_helper.rb
View file @
463644c8
...
@@ -17,21 +17,14 @@ require 'email_spec'
...
@@ -17,21 +17,14 @@ require 'email_spec'
# in spec/support/ and its subdirectories.
# in spec/support/ and its subdirectories.
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
# Use capybara-webkit
Capybara
.
javascript_driver
=
:webkit
RSpec
.
configure
do
|
config
|
RSpec
.
configure
do
|
config
|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config
.
mock_with
:rspec
config
.
mock_with
:rspec
config
.
include
LoginMacros
config
.
include
LoginMacros
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config
.
fixture_path
=
"
#{
::
Rails
.
root
}
/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# examples within a transaction, remove the following line or assign false
# instead of true.
# instead of true.
...
@@ -52,6 +45,12 @@ RSpec.configure do |config|
...
@@ -52,6 +45,12 @@ RSpec.configure do |config|
DatabaseCleaner
.
start
DatabaseCleaner
.
start
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
# !!! Observers disabled by default in tests
#
# Use next code to enable observers
# before(:each) { ActiveRecord::Base.observers.enable(:all) }
#
ActiveRecord
::
Base
.
observers
.
disable
:all
ActiveRecord
::
Base
.
observers
.
disable
:all
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment