spec/fetcher_spec.rb in lastpass-1.6.0 vs spec/fetcher_spec.rb in lastpass-1.6.1

- old
+ new

@@ -8,10 +8,11 @@ let(:password) { "password" } let(:key_iteration_count) { 5000 } let(:hash) { "7880a04588cfab954aa1a2da98fd9c0d2c6eba4c53e36a94510e6dbf30759256" } let(:session_id) { "53ru,Hb713QnEVM5zWZ16jMvxS0" } + let(:escaped_session_id) { "53ru%2CHb713QnEVM5zWZ16jMvxS0" } let(:session) { LastPass::Session.new session_id, key_iteration_count, "DEADBEEF" } let(:blob_response) { "TFBBVgAAAAMxMjJQUkVNAAAACjE0MTQ5" } let(:blob_bytes) { blob_response.decode64 } let(:blob) { LastPass::Blob.new blob_bytes, key_iteration_count, "DEADBEEF" } @@ -34,11 +35,11 @@ describe ".logout" do it "makes a GET request" do web_client = double "web_client" expect(web_client).to receive(:get) - .with("https://lastpass.com/logout.php?method=cli&noredirect=1", cookies: {"PHPSESSID" => session_id}) + .with("https://lastpass.com/logout.php?method=cli&noredirect=1", cookies: {"PHPSESSID" => escaped_session_id}) .and_return(http_ok "") LastPass::Fetcher.logout session, web_client end it "raises an exception on HTTP error" do @@ -197,10 +198,10 @@ describe ".fetch" do it "makes a GET request" do expect(web_client = double("web_client")).to receive(:get) .with("https://lastpass.com/getaccts.php?mobile=1&b64=1&hash=0.0&hasplugin=3.0.23&requestsrc=cli", format: :plain, - cookies: {"PHPSESSID" => session_id}) + cookies: {"PHPSESSID" => escaped_session_id}) .and_return(http_ok(blob_response)) LastPass::Fetcher.fetch session, web_client end