-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyrax 5 upgrade spec fixing #2089
Conversation
We're not concerned with where the cached file is for testing purposes; so instead of hard-coding a value that can change in the ENV, let's compare the constant that we use in the code. tl;dr - Don't rely on magic strings
The `CleanupAccountJob` was stubbing very nosily; needing to know too much about implementation details of the end-points. Instead this preserves the over-view spec (e.g. what all the cleanup spec actually cleans up) while moving that nosy logic to the constituent endpoint. Most of these specs are testing that the method chains work; which is perhaps adequate as the other option is far more expensive tests (e.g. make a new Fedora node only to then immediately destroy it) I'm also leveraging the new `Redis::Namespace#clear` method. Related to: - resque/redis-namespace#202
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var allColorInputs = $("input[name*='color']") | ||
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() | ||
|
||
var allColorInputs = $("input[name*='color']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}) | ||
|
||
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") | ||
|
||
input.val(input.data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var defaultTarget = $(e.target).data('default-target') | ||
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") | ||
|
||
input.val(input.data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
e.preventDefault() | ||
|
||
var defaultTarget = $(e.target).data('default-target') | ||
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('div.defaultable-colors a.restore-default-color').click(function(e) { | ||
e.preventDefault() | ||
|
||
var defaultTarget = $(e.target).data('default-target') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,20 @@ | |||
$(document).on('turbolinks:load', function() { | |||
$('div.defaultable-colors a.restore-default-color').click(function(e) { | |||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var allColorInputs = $("input[name*='color']") | ||
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() | ||
|
||
var allColorInputs = $("input[name*='color']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}) | ||
|
||
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") | ||
|
||
input.val(input.data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var defaultTarget = $(e.target).data('default-target') | ||
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") | ||
|
||
input.val(input.data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
e.preventDefault() | ||
|
||
var defaultTarget = $(e.target).data('default-target') | ||
var input = $("input[name='admin_appearance["+ defaultTarget +"]']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('div.defaultable-colors a.restore-default-color').click(function(e) { | ||
e.preventDefault() | ||
|
||
var defaultTarget = $(e.target).data('default-target') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,20 @@ | |||
$(document).on('turbolinks:load', function() { | |||
$('div.defaultable-colors a.restore-default-color').click(function(e) { | |||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var allColorInputs = $("input[name*='color']") | ||
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() | ||
|
||
var allColorInputs = $("input[name*='color']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}) | ||
|
||
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('div.defaultable-colors a.restore-default-color').click(function(e) { | ||
e.preventDefault() | ||
|
||
var defaultTarget = $(e.target).data('default-target') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,20 @@ | |||
$(document).on('turbolinks:load', function() { | |||
$('div.defaultable-colors a.restore-default-color').click(function(e) { | |||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
// Grab the data from the ul div | ||
var series_data = new Array(); | ||
var pointer_lookup = new Array(); | ||
var x_ticks = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); | ||
var pointer_lookup = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
//flot loaded? And canvas element supported. | ||
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var allColorInputs = $("input[name*='color']") | ||
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() | ||
|
||
var allColorInputs = $("input[name*='color']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}) | ||
|
||
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,20 @@ | |||
$(document).on('turbolinks:load', function() { | |||
$('div.defaultable-colors a.restore-default-color').click(function(e) { | |||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
// Grab the data from the ul div | ||
var series_data = new Array(); | ||
var pointer_lookup = new Array(); | ||
var x_ticks = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); | ||
var pointer_lookup = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
//flot loaded? And canvas element supported. | ||
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
}; | ||
|
||
global.BlacklightRangeLimit = BlacklightRangeLimit; | ||
}(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
var allColorInputs = $("input[name*='color']") | ||
|
||
allColorInputs.each(function() { | ||
$(this).val($(this).data('default-value')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() | ||
|
||
var allColorInputs = $("input[name*='color']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
}) | ||
|
||
$('.panel-footer a.restore-all-default-colors').click(function(e) { | ||
e.preventDefault() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); | ||
var pointer_lookup = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
//flot loaded? And canvas element supported. | ||
if (domDependenciesMet()) { | ||
// Grab the data from the ul div | ||
var series_data = new Array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array literal notation [] is preferable.
}; | ||
|
||
global.BlacklightRangeLimit = BlacklightRangeLimit; | ||
}(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
max = BlacklightRangeLimit.parseNum($(range_element).find(".max").first().text()); | ||
} | ||
|
||
return [min, max] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
|
||
|
||
var min = max = BlacklightRangeLimit.parseNum(current_limit.find(".single").text()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
You might be leaking a variable (max) here.
🤖 Extract constant to ease testing
13775d6
We're not concerned with where the cached file is for testing purposes;
so instead of hard-coding a value that can change in the ENV, let's
compare the constant that we use in the code.
tl;dr - Don't rely on magic strings
🤖 Re-arrange CleanupAccountJob specs
0dbddad
The
CleanupAccountJob
was stubbing very nosily; needing to know toomuch about implementation details of the end-points. Instead this
preserves the over-view spec (e.g. what all the cleanup spec actually
cleans up) while moving that nosy logic to the constituent endpoint.
Most of these specs are testing that the method chains work; which is
perhaps adequate as the other option is far more expensive tests (e.g.
make a new Fedora node only to then immediately destroy it)
I'm also leveraging the new
Redis::Namespace#clear
method.Related to: