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

Tests failing #46

Closed
suranyami opened this issue Aug 15, 2018 · 4 comments · Fixed by #47
Closed

Tests failing #46

suranyami opened this issue Aug 15, 2018 · 4 comments · Fixed by #47

Comments

@suranyami
Copy link
Contributor

After pulling down a fork of this repo and running mix test we get 6 test failures:

  1) test upload multiple image files (CloudexTest)
     test/cloudex/cloudex_test.exs:23
     match (=) failed
     code:  assert [ok: %Cloudex.UploadedImage{}, ok: %Cloudex.UploadedImage{}, ok: %Cloudex.UploadedImage{}] = Cloudex.upload("test/assets/multiple")
     right: [
              error: "Invalid Signature 9c7baa55fde6dac9e588a15c55d6e08e9805e7ae. String to sign - 'timestamp=1518601215'.",
              error: "Invalid Signature 9c7baa55fde6dac9e588a15c55d6e08e9805e7ae. String to sign - 'timestamp=1518601215'.",
              error: "Invalid Signature 9c7baa55fde6dac9e588a15c55d6e08e9805e7ae. String to sign - 'timestamp=1518601215'."
            ]
     stacktrace:
       test/cloudex/cloudex_test.exs:25: (test)

.

  2) test mixed files / urls (CloudexTest)
     test/cloudex/cloudex_test.exs:47
     match (=) failed
     code:  assert [ok: %Cloudex.UploadedImage{}, ok: %Cloudex.UploadedImage{}, error: "File nonexistent.png does not exist."] = Cloudex.upload(["./test/assets/test.jpg", "nonexistent.png", "https://cdn.mhpbooks.com/uploads/2014/10/shutterstock_172896005.jpg"])
     right: [
              error: "Invalid Signature c01b58a90364ab87c87c644d775656cc73acb20b. String to sign - 'timestamp=1518601220'.",
              error: "Invalid Signature c01b58a90364ab87c87c644d775656cc73acb20b. String to sign - 'timestamp=1518601220'.",
              error: "File nonexistent.png does not exist."
            ]
     stacktrace:
       test/cloudex/cloudex_test.exs:49: (test)



  3) test upload with tags (CloudexTest)
     test/cloudex/cloudex_test.exs:62
     ** (MatchError) no match of right hand side value: {:error, "Invalid Signature 5aa78950587ba5b644b2013d839533867a4c588b. String to sign - 'tags=foo,bar&timestamp=1518601223'."}
     code: {:ok, %Cloudex.UploadedImage{tags: ^tags}} =
     stacktrace:
       test/cloudex/cloudex_test.exs:66: (test)



  4) test upload single image file (CloudexTest)
     test/cloudex/cloudex_test.exs:17
     match (=) failed
     code:  assert {:ok, %Cloudex.UploadedImage{}} = Cloudex.upload("test/assets/test.jpg")
     right: {:error,
             "Invalid Signature 9df6d242c28f0ca2c69e8de07dded0667a74ba5e. String to sign - 'timestamp=1518601221'."}
     stacktrace:
       test/cloudex/cloudex_test.exs:19: (test)

.

  5) test upload image url (CloudexTest)
     test/cloudex/cloudex_test.exs:33
     match (=) failed
     code:  assert {:ok, %Cloudex.UploadedImage{}} = Cloudex.upload("http://cdn.mhpbooks.com/uploads/2014/10/shutterstock_172896005.jpg")
     right: {:error,
             "Invalid Signature 2a35268695868d218519042e520d65f7b9a1796a. String to sign - 'timestamp=1518601223'."}
     stacktrace:
       test/cloudex/cloudex_test.exs:35: (test)

...

  6) test upload with phash (CloudexTest)
     test/cloudex/cloudex_test.exs:75
     ** (MatchError) no match of right hand side value: {:error, "Invalid Signature b523ad9a26a6c1f495deb7d4f7162aae2ac465eb. String to sign - 'phash=true&timestamp=1518601222'."}
     code: {:ok, uploaded_image} = Cloudex.upload(["./test/assets/test.jpg"], %{phash: "true"})
     stacktrace:
       test/cloudex/cloudex_test.exs:77: (test)
@suranyami
Copy link
Contributor Author

Does this mean that the fixtures need to be recaptured with exvcr?

@smeevil
Copy link
Owner

smeevil commented Aug 15, 2018

hi @suranyami,

Thank you for your time and effort. I saw the errors pop up indeed, but have not really had the time as of yet to take a good look at it. I think you are right about the exvcr's needing to be rerecorded. If you could give that I try, I'd be very grateful :) As soon as this is in working order again, I'll merge and release the update right away!

Gerard.

@suranyami
Copy link
Contributor Author

Excellent. Will give it a go. Just wanted to confirm that was the next step to try.

@suranyami
Copy link
Contributor Author

@smeevil A question about this: are there sandbox credentials for Cloudinary that can safely be used to record successful requests/responses? I can use my own account, but that might expose my credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants