Skip to content

Commit 6c9f971

Browse files
committed
Fixed spec, headers returned in no particular order.
1 parent 53c06f3 commit 6c9f971

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

spec/grape/endpoint_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ def app; subject end
6161

6262
get('/get/cookies')
6363

64-
last_response.headers['Set-Cookie'].tap { |set_cookies|
65-
set_cookies.should =~ /my-awesome-cookie1=is\+cool\n/
66-
set_cookies.should =~ /my-awesome-cookie2=is\+cool\+too;\ domain=my\.example\.com;\ path=\/;\ secure\n/
67-
set_cookies.should =~ /cookie3=symbol\n/
68-
set_cookies.should =~ /cookie4=secret\+code\+here/
69-
}
64+
last_response.headers['Set-Cookie'].split("\n").sort.should eql [
65+
"cookie3=symbol",
66+
"cookie4=secret+code+here",
67+
"my-awesome-cookie1=is+cool",
68+
"my-awesome-cookie2=is+cool+too; domain=my.example.com; path=/; secure"
69+
]
7070
end
7171

7272
it "should set browser cookies and should not set response cookies" do
@@ -102,9 +102,10 @@ def app; subject end
102102
end
103103
get('/test', {}, 'HTTP_COOKIE' => 'delete_this_cookie=1; and_this=2')
104104
last_response.body.should == '3'
105-
last_response.headers['Set-Cookie'].should ==
106-
"delete_this_cookie=deleted; expires=Thu, 01-Jan-1970 00:00:00 GMT\n" +
107-
'and_this=deleted; expires=Thu, 01-Jan-1970 00:00:00 GMT'
105+
last_response.headers['Set-Cookie'].split("\n").sort.should == [
106+
"and_this=deleted; expires=Thu, 01-Jan-1970 00:00:00 GMT",
107+
"delete_this_cookie=deleted; expires=Thu, 01-Jan-1970 00:00:00 GMT"
108+
]
108109
end
109110
end
110111

0 commit comments

Comments
 (0)