Commit 00834c01 by tady

test pass

parent eeb8d215
guard :rspec, all_after_pass: true, spring: true do # guard :rspec, all_after_pass: true do
watch(%r{^spec/.+_spec\.rb$}) # watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' } # watch('spec/spec_helper.rb') { 'spec' }
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } # watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } # watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { 'spec/features' } # watch(%r{^app/(.*)(\.erb|\.haml)$}) { 'spec/features' }
watch(%r{^spec/factories/(.+)\.rb$}) { 'spec/factories_spec.rb' } # watch(%r{^spec/factories/(.+)\.rb$}) { 'spec/factories_spec.rb' }
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' } # watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
watch('config/routes.rb') { 'spec/routing' } # watch('config/routes.rb') { 'spec/routing' }
watch('app/controllers/application_controller.rb') { 'spec/controllers' } # watch('app/controllers/application_controller.rb') { 'spec/controllers' }
end # end
# guard :rubocop, all_after_pass: true, cli: ['--rails', '--auto-correct'] do
# watch(%r{.+\.rb$})
# watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
# end
guard :rubocop, all_after_pass: true, cli: ['--rails', '--auto-correct'] do guard :rubocop do
watch(%r{.+\.rb$}) watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end end
guard :rspec do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^spec/spec_helper\.rb$}) { |m| 'spec' }
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
%W(spec/routing/#{m[1]}_routing_spec.rb spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb spec/requests/#{m[1]}_spec.rb)
end
end
...@@ -36,7 +36,7 @@ $ bundle exec rake db:seed ...@@ -36,7 +36,7 @@ $ bundle exec rake db:seed
Set ENV before start server. Set ENV before start server.
``` ```
$ . .env $ source .env
$ bundle exec rails s $ bundle exec rails s
``` ```
......
...@@ -20,13 +20,13 @@ describe 'Request via js', js: true do ...@@ -20,13 +20,13 @@ describe 'Request via js', js: true do
it 'show first post' do it 'show first post' do
page.save_screenshot(Rails.root.join('tmp', 'screenshots', "a-#{Time.now.strftime('%Y-%m-%d %H%M%S')}.png")) page.save_screenshot(Rails.root.join('tmp', 'screenshots', "a-#{Time.now.strftime('%Y-%m-%d %H%M%S')}.png"))
expect(page.find('#list_post div.title a').text).to include('ruby rspec') expect(page.find('.panel-title a').text).to include('ruby rspec')
end end
it 'click post and show' do it 'click post and show' do
find('.post-list:nth-child(3)').click find('.post-list:nth-child(3)').click
page.save_screenshot(Rails.root.join('tmp', 'screenshots', "b-#{Time.now.strftime('%Y-%m-%d %H%M%S')}.png")) page.save_screenshot(Rails.root.join('tmp', 'screenshots', "b-#{Time.now.strftime('%Y-%m-%d %H%M%S')}.png"))
expect(page.find('#list_post div.title a').text).to include('java java...') expect(page.find('.panel-title a').text).to include('java java...')
end end
after :each do after :each do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment