0
describe BranchController do
0
+ @git = Git.singleton_new
0
Git.command_response["branch", "-r"] = " origin/master\n origin/release\n origin/task"
0
Git.command_response["branch"] = "* master\n task"
0
describe "when you have submodules" do
0
- it "should
call submodules.init_and_update" do
0
+ it "should
stash, restore, then call submodules.init_and_update" do
0
@set_branch_to_choose.call("task")
0
git = Git.singleton_new
0
- git.submodule.should_receive(:list).and_return([{:name => "mod"}])
0
+ @submodule = stub("submodule", :stash => true, :restore => true)
0
+ git.submodule.should_receive(:all).any_number_of_times.and_return([@submodule])
0
git.submodule.should_receive(:init_and_update)
0
output = capture_output do
0
dispatch(:controller => "branch", :action => "switch")
0
TextMate::UI.should_receive(:request_string).with(@get_branch_name_params).and_return("release")
0
Git.command_response["branch", "--track", "release", "origin/release"] = %{Branch release set up to track remote branch refs/remotes/origin/release.\n}
0
Git.command_response["checkout", "release"] = %{Switched to branch "release"\n}
0
+ @git.submodule.stub!(:all).and_return([])
0
output = capture_output do
0
dispatch(:controller => "branch", :action => "switch")
0
@@ -134,10 +137,10 @@ EOF
0
@git.branch.stub!(:list_names).and_return(["master", "release", "old_skool"])
0
TextMate::UI.should_receive(:request_item).with(:title => "Merge", :prompt => "Merge which branch into 'master':", :items => ["release", "old_skool"], :force_pick => true).and_return("release")
0
- @git.should_receive(:merge).with("release").and_return({:text => "Success!", :conflicts => [] })
0
it "should merge a branch" do
0
+ @git.should_receive(:merge).with("release").and_return({:text => "Success!", :conflicts => [] })
0
output = capture_output do
0
dispatch(:controller => "branch", :action => "merge")
0
output.should include("Success!")
0
- it "should update_submodules_si_hay" do
0
- @controller.should_receive(:update_submodules_si_hay)
0
+ it "should run with_submodule_stashing" do
0
+ @controller.should_receive(:with_submodule_stashing)
0
capture_output { dispatch(:controller => "branch", :action => "merge") }
Comments
No one has commented yet.