File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 28
28
29
29
Cucumber ::Rake ::Task . new ( :cucumber ) do |t |
30
30
version = ENV . fetch ( "RAILS_VERSION" , "~> 4.2.0" )
31
- cucumber_flag = "--tags ~@rails_post_5"
32
31
tags = [ ]
32
+
33
33
if version . to_f >= 5.1
34
34
tags << "~@rails_pre_5.1"
35
35
end
@@ -38,8 +38,13 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
38
38
tags << "~@rails_pre_5"
39
39
end
40
40
41
+ if version . to_f == 5.0
42
+ tags << "~@system_test"
43
+ end
44
+
41
45
if tags . empty?
42
46
tags << "~@rails_post_5"
47
+ tags << "~@system_test"
43
48
end
44
49
45
50
cucumber_flag = tags . map { |tag | "--tag #{ tag } " }
Original file line number Diff line number Diff line change 20
20
gsub_file 'Gemfile' , /^.*\b gem 'rails.*$/ , ''
21
21
gsub_file "Gemfile" , /.*web-console.*/ , ''
22
22
gsub_file "Gemfile" , /.*debugger.*/ , ''
23
+ gsub_file "Gemfile" , /.*puma.*/ , ""
23
24
24
25
if Rails ::VERSION ::STRING >= '5.0.0'
25
26
append_to_file ( 'Gemfile' , "gem 'rails-controller-testing', :git => 'https://github.com/rails/rails-controller-testing'\n " )
Original file line number Diff line number Diff line change
1
+ Feature : System spec
2
+
3
+ System specs are RSpec's wrapper around Rails' own
4
+ [system tests](http://guides.rubyonrails.org/testing.html#system-testing).
5
+ We encourage you to familiarse yourself with their documentation.
6
+
7
+ RSpec **does not** use your `ApplicationSystemTestCase` helper. Instead it uses
8
+ the default `driven_by(:selenium)` from Rails. If you want to override this
9
+ behaviour you can call `driven_by` manually in a test.
10
+
11
+
12
+ @system_test
13
+ Scenario : System specs
14
+ Given a file named "spec/system/widget_system_spec.rb" with:
15
+ """ruby
16
+ require "rails_helper"
17
+
18
+ RSpec.describe "Widget management", :type => :system do
19
+ before do
20
+ driven_by(:rack_test)
21
+ end
22
+
23
+ it "enables me to create widgets" do
24
+ visit "/widgets/new"
25
+
26
+ fill_in "Name", :with => "My Widget"
27
+ click_button "Create Widget"
28
+
29
+ expect(page).to have_text("Widget was successfully created.")
30
+ end
31
+ end
32
+ """
33
+ When I run `rspec spec/system/widget_system_spec.rb`
34
+ Then the exit status should be 0
35
+ And the output should contain "1 example, 0 failures"
You can’t perform that action at this time.
0 commit comments