Skip to content

Commit dbe99ee

Browse files
committedAug 23, 2016
Fixed deprecated spec methods added explicit feature type
1 parent 9e9bcdd commit dbe99ee

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed
 

‎spec/features/edit_admin_order_spec.rb

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
require 'spec_helper'
2-
3-
describe 'notes on edit admin order page' do
4-
before(:each) do
1+
describe 'notes on edit admin order page', type: :feature do
2+
before(:each) do
53
admin_user = create(:admin_user)
6-
stub_admin_login! admin_user
4+
stub_admin_login!(admin_user)
75
end
86

97
context 'creating', js: true do
@@ -14,14 +12,14 @@
1412
end
1513

1614
it 'does not show the create note form initially' do
17-
expect(find('.js-create-note-form', visible: false).visible?).to be_false
15+
expect(find('.js-create-note-form', visible: false).visible?).to be false
1816
end
1917

2018
it 'shows the create note form after clicking the create note button' do
2119
within_fieldset 'admin_order_edit_notes' do
2220
click_button 'Create New Note'
2321
end
24-
expect(find('.js-create-note-form', visible: false).visible?).to be_true
22+
expect(find('.js-create-note-form', visible: false).visible?).to be true
2523
end
2624

2725
it 'can successfully create an unimportant note' do

‎spec/features/edit_admin_user_spec.rb

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
require 'spec_helper'
2-
3-
describe 'notes on edit admin user page' do
4-
before(:each) do
1+
describe 'notes on edit admin user page', type: :feature do
2+
before(:each) do
53
admin_user = create(:admin_user)
6-
stub_admin_login! admin_user
4+
stub_admin_login!(admin_user)
75
end
86

97
context 'creating', js: true do
@@ -14,14 +12,14 @@
1412
end
1513

1614
it 'does not show the create note form initially' do
17-
expect(find('.js-create-note-form', visible: false).visible?).to be_false
15+
expect(find('.js-create-note-form', visible: false).visible?).to be false
1816
end
1917

2018
it 'shows the create note form after clicking the create note button' do
2119
within_fieldset 'admin_user_edit_notes' do
2220
click_button 'Create New Note'
2321
end
24-
expect(find('.js-create-note-form', visible: false).visible?).to be_true
22+
expect(find('.js-create-note-form', visible: false).visible?).to be true
2523
end
2624

2725
it 'can successfully create an unimportant note' do

‎spec/models/spree/notes_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@
3333

3434
it '.important scope returns only important notes' do
3535
Spree::Note.important.each do |note|
36-
expect(note.important).to be_true
36+
expect(note.important).to be true
3737
end
3838
end
3939

4040
it '.not_important scope returns only unimportant notes' do
4141
Spree::Note.not_important.each do |note|
42-
expect(note.important).to be_false
42+
expect(note.important).to be false
4343
end
4444
end
4545

4646
context 'finders always return notes ordered' do
4747
it 'with important notes first primarily' do
4848
Spree::Note.all.each_cons(2) do |current_note, next_note|
4949
if current_note.important != next_note.important
50-
expect(next_note.important).to be_false
50+
expect(next_note.important).to be false
5151
end
5252
end
5353
end

‎spec/spec_helper.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Testing support from spree_core
1414
require 'spree/testing_support/factories'
1515
require 'spree/testing_support/flash'
16+
require 'spree/testing_support/authorization_helpers'
1617

1718
# Requires supporting ruby files with custom matchers and macros, etc,
1819
# in spec/support/ and its subdirectories.
@@ -41,7 +42,7 @@
4142

4243
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
4344
config.before :each do
44-
DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
45+
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
4546
DatabaseCleaner.start
4647
end
4748

0 commit comments

Comments
 (0)
Please sign in to comment.