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

Rails 5.2 #1771

Closed
wants to merge 20 commits into from
Closed

Rails 5.2 #1771

Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −14
Diff settings

Always

Just for now

fix rubygems api controller test

rails/rails#32673

Rails 5.2.1 broke backwards compatibility with setting RAW_POST_DATA in
a test.
  • Loading branch information...
thomasdziedzic committed Aug 24, 2018
commit c01be79670dd2323ab9abf6f202fa23d4970dcaa
@@ -202,8 +202,7 @@ def self.should_respond_to(format)

context "On POST to create for new gem" do
setup do
@request.env["RAW_POST_DATA"] = gem_file.read
post :create
post :create, body: gem_file.read
end
should respond_with :success
should "register new gem" do
@@ -224,9 +223,8 @@ def self.should_respond_to(format)
number: "0.0.0",
updated_at: 1.year.ago,
created_at: 1.year.ago)
@request.env["RAW_POST_DATA"] = gem_file("test-1.0.0.gem").read
assert_difference 'Delayed::Job.count', 5 do
post :create
post :create, body: gem_file("test-1.0.0.gem").read
end
end
should respond_with :success
@@ -253,8 +251,7 @@ def self.should_respond_to(format)
authors: ["Geddy Lee"],
built_at: @date)

@request.env["RAW_POST_DATA"] = gem_file.read
post :create
post :create, body: gem_file.read
end
should respond_with :conflict
should "not register new version" do
@@ -267,8 +264,7 @@ def self.should_respond_to(format)

context "On POST to create with bad gem" do
setup do
@request.env["RAW_POST_DATA"] = "really bad gem"
post :create
post :create, body: "really bad gem"
end
should respond_with :unprocessable_entity
should "not register gem" do
@@ -282,8 +278,7 @@ def self.should_respond_to(format)
@other_user = create(:user)
@rubygem = create(:rubygem, name: "test", number: "0.0.0", owners: [@other_user])

@request.env["RAW_POST_DATA"] = gem_file("test-1.0.0.gem").read
post :create
post :create, body: gem_file("test-1.0.0.gem").read
end
should respond_with 403
should "not allow new version to be saved" do
@@ -296,8 +291,7 @@ def self.should_respond_to(format)

context "On POST to create with reserved gem name" do
setup do
@request.env["RAW_POST_DATA"] = gem_file("rubygems-0.1.0.gem").read
post :create
post :create, body: gem_file("rubygems-0.1.0.gem").read
end
should respond_with 403
should "not register gem" do
@@ -321,8 +315,7 @@ def self.should_respond_to(format)
should "POST to create for existing gem should not fail" do
requires_toxiproxy
Toxiproxy[:elasticsearch].down do
@request.env["RAW_POST_DATA"] = gem_file("test-1.0.0.gem").read
post :create
post :create, body: gem_file("test-1.0.0.gem").read
assert_response :success
assert_equal @user, Rubygem.last.ownerships.first.user
assert_equal 1, Rubygem.last.ownerships.count
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.