spec/adyen_spec.rb in wvanbergen-adyen-0.1.1 vs spec/adyen_spec.rb in wvanbergen-adyen-0.1.5
- old
+ new
@@ -4,12 +4,12 @@
describe Adyen::Encoding do
it "should a hmac_base64 correcly" do
encoded_str = Adyen::Encoding.hmac_base64('bla', 'bla')
encoded_str.should_not be_blank
encoded_str.size.should == 28
- end
-
+ end
+
it "should gzip_base64 correcly" do
encoded_str = Adyen::Encoding.gzip_base64('bla')
encoded_str.should_not be_blank
encoded_str.size.should == 32
end
@@ -17,29 +17,29 @@
describe Adyen::Formatter::DateTime do
it "should accept dates" do
Adyen::Formatter::DateTime.fmt_date(Date.today).should match(/^\d{4}-\d{2}-\d{2}$/)
end
-
+
it "should accept times" do
Adyen::Formatter::DateTime.fmt_time(Time.now).should match(/^\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z$/)
end
-
+
it "should accept valid time strings" do
Adyen::Formatter::DateTime.fmt_time('2009-01-01T11:11:11Z').should match(/^\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z$/)
- end
-
- it "should accept valid time strings" do
+ end
+
+ it "should accept valid time strings" do
Adyen::Formatter::DateTime.fmt_date('2009-01-01').should match(/^\d{4}-\d{2}-\d{2}$/)
end
it "should raise on an invalid time string" do
lambda { Adyen::Formatter::DateTime.fmt_time('2009-01-01 11:11:11') }.should raise_error
- end
+ end
it "should raise on an invalid date string" do
lambda { Adyen::Formatter::DateTime.fmt_date('2009-1-1') }.should raise_error
- end
+ end
end
describe Adyen::Formatter::Price do
it "should return a Fixnum with digits only when converting to cents" do
Adyen::Formatter::Price.in_cents(33.76).should be_kind_of(Fixnum)
\ No newline at end of file