Permalink
Browse files

Merge pull request #483 from darkhelmet/bad-characters-test

Add test for bad characters in description/summary
  • Loading branch information...
2 parents 713583e + 7f777bd commit 8e9f2869d22ec8fe542ad1bae5bb61aea15988ce @cmeiklejohn cmeiklejohn committed Nov 4, 2012
View
@@ -83,3 +83,10 @@ Feature: Push Gems
Then I should see "RubyGems.org cannot process this gem."
And I should not see "Error:"
And I should not see "No metadata found!"
+
+ Scenario: User pushes gem with bad description
+ Given I am signed up as "email@person.com"
+ And I have an API key for "email@person.com/password"
+ And I have a gem "bad-characters" with version "0.0.0" and summary "Breaking this field later"
+ When I push the fixture gem "bad-characters-1.0.0.gem" with my API key
+ Then I should see "RubyGems.org cannot process this gem. Please try rebuilding it and installing it locally to make sure it's valid."
@@ -5,6 +5,12 @@
@api_key = page.source
end
+When /^I push the fixture gem "([^\"]*)" with my API key$/ do |name|
+ api_key_header
+ path = Rails.root.join('test', 'gems', name)
+ page.driver.post api_v1_rubygems_path, File.read(path), {"CONTENT_TYPE" => "application/octet-stream"}
+end
+
When /^I push the gem "([^\"]*)" with my API key$/ do |name|
api_key_header
path = File.join(TEST_DIR, name)
@@ -6,6 +6,10 @@
build_gem(name, version, summary)
end
+Given /^I have a gem "([^\"]*)" with version "([^\"]*)" and a bogus summary$/ do |name, version|
+ build_gem(name, version, "There\x91s nothing.")
+end
+
Given /^I have a gem "([^\"]*)" with version "([^\"]*)" and platform "([^\"]*)"$/ do |name, version, platform|
build_gem(name, version, "Gemcutter", platform)
end
Binary file not shown.

0 comments on commit 8e9f286

Please sign in to comment.