{"action":"closed","issue":{"url":"https://api.github.com/repos/rubencaro/cipher/issues/3","repository_url":"https://api.github.com/repos/rubencaro/cipher","labels_url":"https://api.github.com/repos/rubencaro/cipher/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/rubencaro/cipher/issues/3/comments","events_url":"https://api.github.com/repos/rubencaro/cipher/issues/3/events","html_url":"https://github.com/rubencaro/cipher/issues/3","id":150482911,"number":3,"title":"Decrypting a phoney value breaks when testing","user":{"login":"suprafly","id":523463,"avatar_url":"https://avatars.githubusercontent.com/u/523463?v=3","gravatar_id":"","url":"https://api.github.com/users/suprafly","html_url":"https://github.com/suprafly","followers_url":"https://api.github.com/users/suprafly/followers","following_url":"https://api.github.com/users/suprafly/following{/other_user}","gists_url":"https://api.github.com/users/suprafly/gists{/gist_id}","starred_url":"https://api.github.com/users/suprafly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suprafly/subscriptions","organizations_url":"https://api.github.com/users/suprafly/orgs","repos_url":"https://api.github.com/users/suprafly/repos","events_url":"https://api.github.com/users/suprafly/events{/privacy}","received_events_url":"https://api.github.com/users/suprafly/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-22T22:10:45Z","updated_at":"2016-04-23T05:49:06Z","closed_at":"2016-04-23T05:49:06Z","body":"A simple test:\r\n```\r\n    test \"decrypt something phoney\" do\r\n      {resp, _} = Cipher.decrypt(\"nonsense\")    \r\n      assert resp == :error\r\n    end\r\n```\r\n\r\nReturns this error:\r\n```\r\n    ** (ArgumentError) argument error\r\n         stacktrace:\r\n           (crypto) :crypto.aes_cbc_crypt(\"f501bc2316ae38b1\", \"33G<I0WWJiEn1{;Y\", <<158, 137, 236, 122, 123, 30>>, false)\r\n       lib/cipher.ex:39: Cipher.decrypt/1\r\n\r\n```\r\nI suspect that during testing, the helper functions to retrieve the :keyphrase and :ivphrase are not working correctly: https://github.com/rubencaro/cipher/blob/master/lib/cipher/helpers.ex\r\n\r\nYou can see this by extracting the definition and trying it in a test. When I add this line to my test:\r\n    `IO.inspect Application.get_env(Mix.Project.get!.project[:app], :keyphrase, nil)\r\n`\r\n...the outut is: nil"}}