0
@@ -13,22 +13,58 @@ describe "CapGun" do
0
- include CapGun::Helper
0
+ describe "mail settings" do
0
+ include CapGun::Helper
0
+ it "raises if we dont have settings" do
0
+ capistrano = stub_everything
0
+ lambda { CapGun::Helper.load_mailer_config(capistrano) }.should.raise(ArgumentError).message.should == "You must define ActionMailer settings in 'cap_gun_action_mailer_config'"
0
- it "raises if we dont have settings" do
0
- capistrano = stub_everything
0
- lambda { CapGun::Helper.load_mailer_config(capistrano) }.should.raise(ArgumentError).message.should == "You must define ActionMailer settings in 'cap_gun_action_mailer_config'"
0
+ it "gets action mailer config from capistrano" do
0
+ capistrano = stub(:cap_gun_action_mailer_config => {:account => "foo@gmail.com", :password => "password"})
0
+ CapGun::Helper.load_mailer_config(capistrano)
0
+ ActionMailer::Base.smtp_settings.should == {:account => "foo@gmail.com", :password => "password"}
0
- it "gets action mailer config from capistrano" do
0
- capistrano = stub(:cap_gun_action_mailer_config => {:account => "foo@gmail.com", :password => "password"})
0
- CapGun::Helper.load_mailer_config(capistrano)
0
- ActionMailer::Base.smtp_settings.should == {:account => "foo@gmail.com", :password => "password"}
0
+ describe "misc helpers" do
0
+ include CapGun::Helper
0
+ it "returns nil for current user if platform is win32" do
0
+ expects(:platform).returns("mswin")
0
+ current_user.should.be nil
0
+ it "should get current user from *nix id command" do
0
+ expects(:"`").with('id -un').returns("joe")
0
+ it "returns nil for weird release path" do
0
+ time_from_release("/data/foo/my_release", "PDT").should == nil
0
+ it "parse datetime from release path" do
0
+ time_from_release("/data/foo/releases/20080402152141", "PDT").should == "April 2nd, 2008 3:21 PM PDT"
0
- it "parses datetime from release path" do
0
- time_from_release("/data/foo/releases/20080402152141", "PDT").should == "April 2nd, 2008 3:21 PM PDT"
0
+ it "raises if we dont have at least one recipient" do
0
+ it "passes capistrano into create body" do
0
+ capistrano = { :current_release => "/data/foo", :previous_release => "/data/foo", :cap_gun_options => {:recipients => "joe@example.com"} }
0
+ CapGun::Mailer.any_instance.expects(:create_body).with(capistrano).returns("foo")
0
+ CapGun::Mailer.create_deployment_notification capistrano
Comments
No one has commented yet.