Skip to content

Commit

Permalink
Updating release spec to fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfish committed Jan 8, 2014
1 parent 42d216a commit e8a0aa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/yolo/tasks/ios/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def send_notification(url, password)
mail_options = {
:to => self.mail_to,
:ota_url => url,
:subject => "New #{name} build: #{version} (#{current_branch})",
:subject => "New #{name} build: #{version} #{current_branch}",
:title => name
}
mail_options[:ota_password] = password if password
Expand All @@ -169,7 +169,10 @@ def send_notification(url, password)
# @return [String] The current git branch
def current_branch
git = Yolo::Tools::Git.new
git.current_branch
branch = git.current_branch
if git.current_branch != "(no branch)"
return "(#{branch})"
end
end

#
Expand Down
3 changes: 2 additions & 1 deletion spec/tasks/ios/release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,14 @@
end

it "should build mail options once deployed" do
Yolo::Tools::Git.stub(:current_branch){"develop"}
@release.mail_to = "test@test.com"
@ota.stub(:deploy).and_yield("url", "password")
@email.should_receive(:send).with(
{
:to => "test@test.com",
:ota_url => "url",
:subject=>"New testname build: 1.0",
:subject=>"New testname build: 1.0 (develop)",
:title=>"testname",
:ota_password=>"password"
})
Expand Down

0 comments on commit e8a0aa0

Please sign in to comment.