-
Notifications
You must be signed in to change notification settings - Fork 183
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
[RED-2215] Fix/Improve Live Specs #573
Conversation
0a13e99
to
8373b02
Compare
e21dbec
to
c4617a9
Compare
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.
✅ - good to merge, but I had a few neat picks I couldn't resist. Just if you have time, no biggie.
c.allow_http_connections_when_no_cassette = @previous_allow_http_connections | ||
end | ||
end | ||
|
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.
I'm OK with this solution. 👍
@@ -21,26 +21,26 @@ def it_should_be_creatable(options = {}) | |||
|
|||
before(:all) do | |||
VCR.use_cassette("#{described_class.to_s}_create") do | |||
@object = described_class.create(client, valid_attributes.merge(default_options)) | |||
@creatable_object = described_class.create!(client, valid_attributes.merge(default_options)) |
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.
I love the bang! ❤️
spec/macros/resource_macros.rb
Outdated
@object.send("#{attribute}=", value) | ||
extra.each { |k, v| @object.send("#{k}=", v) } | ||
@updatable_object.send("#{attribute}=", value) | ||
extra.each { |k, v| @updatable_object.send("#{k}=", v) } |
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.
Neat: would it be possible to use public_send
instead?
spec/macros/resource_macros.rb
Outdated
end | ||
|
||
it "should be savable" do | ||
expect(@object.save).to be(true) | ||
expect(@updatable_object.save!).to be(true) |
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.
In this case I think it should be save without the bang.
You could try:
expect(@updatable_object.save!).to be(true) | |
expect(object.save).to be(true), "Expected object to save, but it failed with errors: #{object.errors.full_messages.join(', ')}" |
c4617a9
to
c002382
Compare
c002382
to
26f5277
Compare
Description
Fix and Improve the Live Specs