File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3
3
### Tasks
4
4
* Documenting how to setup Factory Associations [ PR 100] ( https://github.com/shakacode/cypress-on-rails/pull/100 )
5
5
6
+ ### Fixed
7
+ * keep track of factory manual reloads to prevent auto_reload from reloading again [ PR 98] ( https://github.com/shakacode/cypress-on-rails/pull/98 )
8
+
6
9
## [ 1.12.0]
7
10
[ Compare ] : https://github.com/shakacode/cypress-on-rails/compare/v1.11.0...v1.12.0
8
11
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ def build_list(*args)
80
80
end
81
81
82
82
def reload
83
+ @latest_mtime = current_latest_mtime
83
84
logger . info 'Loading Factories'
84
85
factory . reload
85
86
files . each do |file |
@@ -105,14 +106,16 @@ def logger
105
106
CypressOnRails . configuration . logger
106
107
end
107
108
109
+ def current_latest_mtime
110
+ files . map { |file | @file_system . mtime ( file ) } . max
111
+ end
112
+
108
113
def auto_reload
109
- current_latest_mtime = files . map { |file | @file_system . mtime ( file ) } . max
110
- return unless should_reload? ( current_latest_mtime )
111
- @latest_mtime = current_latest_mtime
114
+ return unless should_reload?
112
115
reload
113
116
end
114
117
115
- def should_reload? ( current_latest_mtime )
118
+ def should_reload?
116
119
@always_reload || @latest_mtime . nil? || @latest_mtime < current_latest_mtime
117
120
end
118
121
end
You can’t perform that action at this time.
0 commit comments