Created
August 26, 2014 13:08
-
-
Save jkamenik/400651e196af1d2b495c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "Bulk tagging" do | |
def verify_count(options) | |
options.each do |key,count| | |
expect(find("#results-#{key}")).to have_content count | |
end | |
end | |
def create_tag(tag, on:) | |
visit '/ip_taggings/create_many' | |
fill_in 'ips_and_fqdns', with: Array(on) | |
fill_in 'tag', with: tag | |
click_button'tag-submit-button' | |
end | |
scenario "something" do | |
create_tag "tag", on: '1.1.1.1' | |
verify_count({ | |
'ips-added': 1 | |
}) | |
end | |
scenario "other" do | |
create_tag "tag1", on: %w(google.com amazon.com) | |
verify_count({ | |
'ips-added': 0, | |
'domains-added': 2 | |
}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment