Written the testcase using spec and webmock gem.