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

Fix the failing 2.1 site API fixture issue #151

Merged
merged 3 commits into from
Mar 27, 2015

Conversation

erran-r7
Copy link
Contributor

I took the following steps to update this fixture. I actually had to use rm spec/fixtures/cassettes/basic_site.yml since a new session ID was required.

  • Run the entire RSpec suite
    *Find and note any failures.
  • Set fixtures to record
    On any fixtures which are failing either add the :once or :new_episodes method.
    NOTE: In some cases removing the fixture can be necessary to ensure your session token is new. This problem should probably be looked into...
         Nexpose::Site.new('test site name 1').tap do |site|
           site.description = 'test site description 1'

-          VCR.use_cassette('basic_site') do
+          VCR.use_cassette('basic_site', record: :new_episodes) do
             site.save(connection)
           end
         end
  • Update to a live API environment
    • Set NEXPOSE_HOSTNAME to your Nexpose instance's hostname or IP address.
    • Set NEXPOSE_USERNAME to your Nexpose instance's username.
    • Set NEXPOSE_PASSWORD to your Nexpose instance's password.
  • Re-run RSpec to overwrite the outdated test fixtures.
  • Remove any fixtures that are no longer being used.

@@ -18,6 +18,7 @@
let(:basic_site) do
Nexpose::Site.new('test site name 1').tap do |site|
site.description = 'test site description 1'
site.included_scan_targets[:addresses] = ['localhost']
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use site.included_addresses to be more concise than included_scan_targets[:addresses]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. I didn't look too heavily through the new gem docs. I'll convert to that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: 514f8e0

@gschneider-r7 gschneider-r7 added this to the One Dot Oh milestone Mar 27, 2015
gschneider-r7 added a commit that referenced this pull request Mar 27, 2015
Fix the failing 2.1 site API fixture issue
@gschneider-r7 gschneider-r7 merged commit 76555d5 into staging/v1 Mar 27, 2015
@gschneider-r7 gschneider-r7 deleted the site-api-vcr-fix branch March 27, 2015 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants