Skip to content
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

[#126389] Prevent reservation start when the instrument is offline #706

Merged
merged 6 commits into from
Jul 20, 2016

Conversation

drench
Copy link
Contributor

@drench drench commented Jul 18, 2016

This should prevent "Create & Start" as well as starting reservations for an instrument that is offline. It includes cherry-picks from #696 to bring in the Product#online? and #offline? methods.

@@ -13,3 +13,4 @@
var reserveInterval = #{@instrument.reserve_interval};
var reserveMinimum = #{@instrument.min_reserve_mins || 0};
var reserveMaximum = #{@instrument.max_reserve_mins || 0};
var instrumentOnline = #{@instrument.online? || false};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the || false for? Won't online? always return a boolean?

before { instrument.save! }

context "when an offline reservation does not exist" do
context "when an offline reservation does not exist", :aggregate_failures do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need the aggregate_failures since they're two separate tests?

@jhanggi
Copy link
Contributor

jhanggi commented Jul 20, 2016

One minor comment in the specs, otherwise, 👍

@drench drench merged commit a2de5ca into master Jul 20, 2016
@drench drench deleted the 126389-prevent-start-when-down branch July 20, 2016 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants