File tree 4 files changed +15
-18
lines changed
4 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 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
5
3
admin_user = create ( :admin_user )
6
- stub_admin_login! admin_user
4
+ stub_admin_login! ( admin_user )
7
5
end
8
6
9
7
context 'creating' , js : true do
14
12
end
15
13
16
14
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
18
16
end
19
17
20
18
it 'shows the create note form after clicking the create note button' do
21
19
within_fieldset 'admin_order_edit_notes' do
22
20
click_button 'Create New Note'
23
21
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
25
23
end
26
24
27
25
it 'can successfully create an unimportant note' do
Original file line number Diff line number Diff line change 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
5
3
admin_user = create ( :admin_user )
6
- stub_admin_login! admin_user
4
+ stub_admin_login! ( admin_user )
7
5
end
8
6
9
7
context 'creating' , js : true do
14
12
end
15
13
16
14
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
18
16
end
19
17
20
18
it 'shows the create note form after clicking the create note button' do
21
19
within_fieldset 'admin_user_edit_notes' do
22
20
click_button 'Create New Note'
23
21
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
25
23
end
26
24
27
25
it 'can successfully create an unimportant note' do
Original file line number Diff line number Diff line change 33
33
34
34
it '.important scope returns only important notes' do
35
35
Spree ::Note . important . each do |note |
36
- expect ( note . important ) . to be_true
36
+ expect ( note . important ) . to be true
37
37
end
38
38
end
39
39
40
40
it '.not_important scope returns only unimportant notes' do
41
41
Spree ::Note . not_important . each do |note |
42
- expect ( note . important ) . to be_false
42
+ expect ( note . important ) . to be false
43
43
end
44
44
end
45
45
46
46
context 'finders always return notes ordered' do
47
47
it 'with important notes first primarily' do
48
48
Spree ::Note . all . each_cons ( 2 ) do |current_note , next_note |
49
49
if current_note . important != next_note . important
50
- expect ( next_note . important ) . to be_false
50
+ expect ( next_note . important ) . to be false
51
51
end
52
52
end
53
53
end
Original file line number Diff line number Diff line change 13
13
# Testing support from spree_core
14
14
require 'spree/testing_support/factories'
15
15
require 'spree/testing_support/flash'
16
+ require 'spree/testing_support/authorization_helpers'
16
17
17
18
# Requires supporting ruby files with custom matchers and macros, etc,
18
19
# in spec/support/ and its subdirectories.
41
42
42
43
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
43
44
config . before :each do
44
- DatabaseCleaner . strategy = example . metadata [ :js ] ? :truncation : :transaction
45
+ DatabaseCleaner . strategy = RSpec . current_example . metadata [ :js ] ? :truncation : :transaction
45
46
DatabaseCleaner . start
46
47
end
47
48
You can’t perform that action at this time.
0 commit comments