Skip to content

Commit

Permalink
Replaced FactoryGirl to FactoryBot. (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
dakariakin authored and akz92 committed Jun 18, 2018
1 parent 0828fa7 commit bd72b1b
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 82 deletions.
18 changes: 9 additions & 9 deletions br.html
Expand Up @@ -397,7 +397,7 @@ <h1><a name="let">Use let e let!</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
before { @resource = FactoryGirl.create :device }
before { @resource = FactoryBot.create :device }
before { @type = Type.find @resource.type_id }

it 'sets the type_id field' do
Expand All @@ -411,7 +411,7 @@ <h1><a name="let">Use let e let!</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
let(:resource) { FactoryGirl.create :device }
let(:resource) { FactoryBot.create :device }
let(:type) { Type.find resource.type_id }

it 'sets the type_id field' do
Expand Down Expand Up @@ -530,7 +530,7 @@ <h1><a name="data">Crie apenas os dados necessários</a></h1>
<div>
<pre><code class="ruby">describe "User"
describe ".top" do
before { FactoryGirl.create_list(:user, 3) }
before { FactoryBot.create_list(:user, 3) }
it { User.top(2).should have(2).item }
end
end
Expand Down Expand Up @@ -573,7 +573,7 @@ <h1><a name="factories">Use factories, não fixtures</a></h1>
<p class="correct">bom</p>

<div>
<pre><code class="ruby">user = FactoryGirl.create :user
<pre><code class="ruby">user = FactoryBot.create :user
</code></pre>
</div>

Expand All @@ -585,7 +585,7 @@ <h1><a name="factories">Use factories, não fixtures</a></h1>
</p>

<p>
Aprenda mais sobre <a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>.
Aprenda mais sobre <a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>.
</p>

<p>
Expand Down Expand Up @@ -644,11 +644,11 @@ <h1><a name="sharedexamples">Shared Examples</a></h1>

<div>
<pre><code class="ruby">describe 'GET /devices' do
let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

context 'when shows all resources' do
let!(:not_owned) { FactoryGirl.create factory }
let!(:not_owned) { FactoryBot.create factory }

it 'shows all owned resources' do
page.driver.get uri
Expand All @@ -675,7 +675,7 @@ <h1><a name="sharedexamples">Shared Examples</a></h1>
<div>
<pre><code class="ruby">describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

it_behaves_like 'a listable resource'
Expand Down Expand Up @@ -1055,7 +1055,7 @@ <h1><a name="libraries">Bibliotecas (documentação)</a></h1>
<ol>
<li><a href="https://www.relishapp.com/rspec">RSpec Documentation</a></li>
<li><a href="https://github.com/jnicklas/capybara">Capybara Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_girl">Factory Girl Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_bot">Factory Bot Documentation</a></li>
<li><a href="https://github.com/bblimke/webmock">Webmock Documentation</a></li>
<li><a href="https://github.com/travisjeffery/timecop">Timecop Documentation</a></li>
<li><a href="http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames">Shoulda Matchers</a></li>
Expand Down
18 changes: 9 additions & 9 deletions es.html
Expand Up @@ -432,7 +432,7 @@ <h1><a name="let">Utiliza let y let!</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
before { @resource = FactoryGirl.create :device }
before { @resource = FactoryBot.create :device }
before { @type = Type.find @resource.type_id }

it 'sets the type_id field' do
Expand All @@ -446,7 +446,7 @@ <h1><a name="let">Utiliza let y let!</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
let(:resource) { FactoryGirl.create :device }
let(:resource) { FactoryBot.create :device }
let(:type) { Type.find resource.type_id }

it 'sets the type_id field' do
Expand Down Expand Up @@ -559,7 +559,7 @@ <h1><a name="data">Crea sólo los datos que necesites</a></h1>
<div>
<pre><code class="ruby">describe "User"
describe ".top" do
before { FactoryGirl.create_list(:user, 3) }
before { FactoryBot.create_list(:user, 3) }
it { User.top(2).should have(2).item }
end
end
Expand Down Expand Up @@ -600,7 +600,7 @@ <h1><a name="factories">Utiliza factories y no fixtures</a></h1>
<p class="correct">Correcto</p>

<div>
<pre><code class="ruby">user = FactoryGirl.create :user
<pre><code class="ruby">user = FactoryBot.create :user
</code></pre>
</div>

Expand All @@ -612,7 +612,7 @@ <h1><a name="factories">Utiliza factories y no fixtures</a></h1>
</p>

<p>
Aprender más sobre <a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>.
Aprender más sobre <a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>.
</p>

<p>
Expand Down Expand Up @@ -666,11 +666,11 @@ <h1><a name="sharedexamples">Ejemplos compartidos</a></h1>

<div>
<pre><code class="ruby">describe 'GET /devices' do
let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

context 'when shows all resources' do
let!(:not_owned) { FactoryGirl.create factory }
let!(:not_owned) { FactoryBot.create factory }

it 'shows all owned resources' do
page.driver.get uri
Expand All @@ -697,7 +697,7 @@ <h1><a name="sharedexamples">Ejemplos compartidos</a></h1>
<div>
<pre><code class="ruby">describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

it_behaves_like 'a listable resource'
Expand Down Expand Up @@ -1061,7 +1061,7 @@ <h1><a name="libraries">Bibliotecas (documentación)</a></h1>
<ol>
<li><a href="https://www.relishapp.com/rspec">Documentación de RSpec</a></li>
<li><a href="https://github.com/jnicklas/capybara">Documentación de Capybara</a></li>
<li><a href="https://github.com/thoughtbot/factory_girl">Documentación de Factory Girl</a></li>
<li><a href="https://github.com/thoughtbot/factory_bot">Documentación de Factory Bot</a></li>
<li><a href="https://github.com/bblimke/webmock">Documentación de Webmock</a></li>
<li><a href="https://github.com/travisjeffery/timecop">Documentación de Timecop</a></li>
<li><a href="http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames">Shoulda Matchers</a></li>
Expand Down
18 changes: 9 additions & 9 deletions fr.html
Expand Up @@ -418,7 +418,7 @@ <h1><a name="let">Utiliser «let» et «let!»</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
before { @resource = FactoryGirl.create :device }
before { @resource = FactoryBot.create :device }
before { @type = Type.find @resource.type_id }

it 'sets the type_id field' do
Expand All @@ -432,7 +432,7 @@ <h1><a name="let">Utiliser «let» et «let!»</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
let(:resource) { FactoryGirl.create :device }
let(:resource) { FactoryBot.create :device }
let(:type) { Type.find resource.type_id }

it 'sets the type_id field' do
Expand Down Expand Up @@ -540,7 +540,7 @@ <h1><a name="data">Créer seulement les données requises</a></h1>
<div>
<pre><code class="ruby">describe "User"
describe ".top" do
before { FactoryGirl.create_list(:user, 3) }
before { FactoryBot.create_list(:user, 3) }
it { expect(User.top(2)).to have(2).item }
end
end
Expand Down Expand Up @@ -580,7 +580,7 @@ <h1><a name="factories">Utiliser les «factories» et ne pas utiliser les «fixt
<p class="correct">bon</p>

<div>
<pre><code class="ruby">user = FactoryGirl.create :user
<pre><code class="ruby">user = FactoryBot.create :user
</code></pre>
</div>

Expand All @@ -589,7 +589,7 @@ <h1><a name="factories">Utiliser les «factories» et ne pas utiliser les «fixt
</p>

<p>
En apprendre plus sur <a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>.
En apprendre plus sur <a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>.
</p>

<p>
Expand Down Expand Up @@ -644,11 +644,11 @@ <h1><a name="sharedexamples">Exemples partagés</a></h1>

<div>
<pre><code class="ruby">describe 'GET /devices' do
let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

context 'when shows all resources' do
let!(:not_owned) { FactoryGirl.create factory }
let!(:not_owned) { FactoryBot.create factory }

it 'shows all owned resources' do
page.driver.get uri
Expand All @@ -675,7 +675,7 @@ <h1><a name="sharedexamples">Exemples partagés</a></h1>
<div>
<pre><code class="ruby">describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

it_behaves_like 'a listable resource'
Expand Down Expand Up @@ -1007,7 +1007,7 @@ <h1><a name="libraries">Documentation</a></h1>
<ol>
<li><a href="https://www.relishapp.com/rspec">RSpec Documentation</a></li>
<li><a href="https://github.com/jnicklas/capybara">Capybara Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_girl">Factory Girl Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_bot">Factory Bot Documentation</a></li>
<li><a href="https://github.com/bblimke/webmock">Webmock Documentation</a></li>
<li><a href="https://github.com/travisjeffery/timecop">Timecop Documentation</a></li>
<li><a href="http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames">Shoulda Matchers</a></li>
Expand Down
16 changes: 8 additions & 8 deletions index.html
Expand Up @@ -429,7 +429,7 @@ <h1><a name="let">Use let and let!</a></h1>

{% highlight ruby %}
describe '#type_id' do
before { @resource = FactoryGirl.create :device }
before { @resource = FactoryBot.create :device }
before { @type = Type.find @resource.type_id }

it 'sets the type_id field' do
Expand All @@ -444,7 +444,7 @@ <h1><a name="let">Use let and let!</a></h1>

{% highlight ruby %}
describe '#type_id' do
let(:resource) { FactoryGirl.create :device }
let(:resource) { FactoryBot.create :device }
let(:type) { Type.find resource.type_id }

it 'sets the type_id field' do
Expand Down Expand Up @@ -553,7 +553,7 @@ <h1><a name="data">Create only the data you need</a></h1>
{% highlight ruby %}
RSpec.describe User do
describe ".top" do
before { FactoryGirl.create_list(:user, 3) }
before { FactoryBot.create_list(:user, 3) }
it { expect(described_class.top(2).size).to eq 2 }
end
end
Expand All @@ -574,7 +574,7 @@ <h1><a name="factories">Use factories and not fixtures</a></h1>

<p>
This is an old topic, but it's still good to remember it. Do not use fixtures because they are difficult to control, use factories instead. Use them to reduce the verbosity
on creating new data (learn about <a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>).
on creating new data (learn about <a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>).
</p>
</p>

Expand All @@ -596,7 +596,7 @@ <h1><a name="factories">Use factories and not fixtures</a></h1>
<p class="spec-title spec-correct">good</p>

{% highlight ruby %}
user = FactoryGirl.create :user
user = FactoryBot.create :user
{% endhighlight %}
</div>

Expand Down Expand Up @@ -659,12 +659,12 @@ <h1><a name="shared">Shared Examples</a></h1>
{% highlight ruby %}
describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let!(:uri) { '/devices' }

context 'when shows all resources' do

let!(:not_owned) { FactoryGirl.create factory }
let!(:not_owned) { FactoryBot.create factory }

it 'shows all owned resources' do
page.driver.get uri
Expand Down Expand Up @@ -694,7 +694,7 @@ <h1><a name="shared">Shared Examples</a></h1>
{% highlight ruby %}
describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let!(:uri) { '/devices' }

it_behaves_like 'a listable resource'
Expand Down
20 changes: 10 additions & 10 deletions jp.html
Expand Up @@ -496,7 +496,7 @@ <h1><a name="let">letとlet!を使う</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
before { @resource = FactoryGirl.create :device }
before { @resource = FactoryBot.create :device }
before { @type = Type.find @resource.type_id }

it 'sets the type_id field' do
Expand All @@ -510,7 +510,7 @@ <h1><a name="let">letとlet!を使う</a></h1>

<div>
<pre><code class="ruby">describe '#type_id' do
let(:resource) { FactoryGirl.create :device }
let(:resource) { FactoryBot.create :device }
let(:type) { Type.find resource.type_id }

it 'sets the type_id field' do
Expand Down Expand Up @@ -651,7 +651,7 @@ <h1><a name="data">必要なデータだけ作る</a></h1>
<div>
<pre><code class="ruby">describe "User"
describe ".top" do
before { FactoryGirl.create_list(:user, 3) }
before { FactoryBot.create_list(:user, 3) }
it { expect(User.top(2)).to have(2).item }
end
end
Expand Down Expand Up @@ -696,7 +696,7 @@ <h1><a name="factories">fixtureの代わりにfactoryを使う</a></h1>
<p class="correct">good</p>

<div>
<pre><code class="ruby">user = FactoryGirl.create :user
<pre><code class="ruby">user = FactoryBot.create :user
</code></pre>
</div>

Expand All @@ -715,10 +715,10 @@ <h1><a name="factories">fixtureの代わりにfactoryを使う</a></h1>


<!-- <p>
Learn more about <a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>.
Learn more about <a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>.
</p> -->
<p>
<a href="https://github.com/thoughtbot/factory_girl">Factory Girl</a>をもっと学ぶ。
<a href="https://github.com/thoughtbot/factory_bot">Factory Bot</a>をもっと学ぶ。
</p>

<p>
Expand Down Expand Up @@ -779,11 +779,11 @@ <h1><a name="sharedexamples">Shared Examples</a></h1>

<div>
<pre><code class="ruby">describe 'GET /devices' do
let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

context 'when shows all resources' do
let!(:not_owned) { FactoryGirl.create factory }
let!(:not_owned) { FactoryBot.create factory }

it 'shows all owned resources' do
page.driver.get uri
Expand All @@ -810,7 +810,7 @@ <h1><a name="sharedexamples">Shared Examples</a></h1>
<div>
<pre><code class="ruby">describe 'GET /devices' do

let!(:resource) { FactoryGirl.create :device, created_from: user.id }
let!(:resource) { FactoryBot.create :device, created_from: user.id }
let(:uri) { '/devices' }

it_behaves_like 'a listable resource'
Expand Down Expand Up @@ -1283,7 +1283,7 @@ <h1><a name="libraries">Libraries (documentation)</a></h1>
<ol>
<li><a href="https://www.relishapp.com/rspec">RSpec Documentation</a></li>
<li><a href="https://github.com/jnicklas/capybara">Capybara Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_girl">Factory Girl Documentation</a></li>
<li><a href="https://github.com/thoughtbot/factory_bot">Factory Bot Documentation</a></li>
<li><a href="https://github.com/bblimke/webmock">Webmock Documentation</a></li>
<li><a href="https://github.com/travisjeffery/timecop">Timecop Documentation</a></li>
<li><a href="http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames">Shoulda Matchers</a></li>
Expand Down

0 comments on commit bd72b1b

Please sign in to comment.