gitlabhq/gitlabhq — pull request #6391 by cirosantilli (2014-02-23 22:10:00+00:00)
Title: New MR default target branch is default of target.

Fixes ACCEPTING MR at http://feedback.gitlab.com/forums/176466-general/suggestions/5518180-smarter-merge-request-target-repo-and-branch-form-

One liner changer + tests ;~

Behavior before this PR: when creating a new MR, the target branch is the first one alphabetically.

Behavior after this PR: when creating a new MR, the target branch is the default of the target repo (which is currently always the current repo).

**TODO**

Works well on interactive tests, but for the unit tests I am unable to change the current branch.

I have tried things like

@project.change_head(branch)

and

click_link("Settings")
select2(branch, from: "Default Branch")
click_button("Save changes")

and many variations without success.

Once this is settled I'll remove the test comments and prints.