<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shepherdMaster</author_name>
  <author_url>https://blog.hatena.ne.jp/shepherdMaster/</author_url>
  <blog_title>世界中の羊をかき集めて</blog_title>
  <blog_url>https://shepherdmaster.hateblo.jp/</blog_url>
  <categories>
    <anon>FactoryGirl</anon>
    <anon>Rails</anon>
  </categories>
  <description>FactoryGirlでARではなくhashのモックデータを返してほしいときがある。 そういう場合は以下のようにすればよい。 FactoryGirl.define do factory :dog, class: Hash do id 1 name 'john' color 'black' initialize_with { attributes } end end initialize_with は初期化処理を定義できるもので、attributesはFactoryGirlのメソッドだけどattributesの戻り値がHashなのでそのまま使っている感じ。 利用するときはいつものようにbuild…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshepherdmaster.hateblo.jp%2Fentry%2F2016%2F11%2F03%2F184557&quot; title=&quot;FactoryGirlで Hashを定義 - 世界中の羊をかき集めて&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-11-03 18:45:57</published>
  <title>FactoryGirlで Hashを定義</title>
  <type>rich</type>
  <url>https://shepherdmaster.hateblo.jp/entry/2016/11/03/184557</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
