FactoryGirlのTraits知らんかったいいな

Traits

Traits allow you to group attributes together and then apply them to any factory.

factory :user, aliases: [:author]

factory :story do
  title "My awesome story"
  author

  trait :published do
    published true
  end

  trait :unpublished do
    published false
  end

  trait :week_long_publishing do
    start_at { 1.week.ago }
    end_at   { Time.now }
  end

  trait :month_long_publishing do
    start_at { 1.month.ago }
    end_at   { Time.now }
  end

  factory :week_long_published_story,    traits: [:published, :week_long_publishing]
  factory :month_long_published_story,   traits: [:published, :month_long_publishing]
  factory :week_long_unpublished_story,  traits: [:unpublished, :week_long_publishing]
  factory :month_long_unpublished_story, traits: [:unpublished, :month_long_publishing]
end

Traits can be used as attributes:

factory :week_long_published_story_with_title, parent: :story do
  published
  week_long_publishing
  title { "Publishing that was started at #{start_at}" }
end
https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#traits

備忘録:Git2.0からgit-pushのデフォルトの挙動が変わる

Git1.8の頃から次のメジャーバージョンアップで変わるよ!って言われているのは知ってたけど1.9じゃなくて2.0なのか次は。

Backward compatibility notes (for Git 2.0)
------------------------------------------

When "git push [$there]" does not say what to push, we have used the
traditional "matching" semantics so far (all your branches were sent
to the remote as long as there already are branches of the same name
over there). In Git 2.0, the default will change to the "simple"
semantics that pushes the current branch to the branch with the same
name, only when the current branch is set to integrate with that
remote branch. There is a user preference configuration variable
"push.default" to change this. If you are an old-timer who is used
to the "matching" semantics, you can set it to "matching" to keep the
traditional behaviour. If you want to live in the future early,
you can set it to "simple" today without waiting for Git 2.0.
https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.3.txt