Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FactoryGirl4に対応。

  • Loading branch information...
commit b4402b8ef62baf6a850c1fa28744a30a4a7bc752 1 parent 1d3db19
@sakomoko authored
View
245 Gemfile.lock
@@ -1,161 +1,182 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.3)
- actionpack (= 3.1.3)
- mail (~> 2.3.0)
- actionpack (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
+ actionmailer (3.1.8)
+ actionpack (= 3.1.8)
+ mail (~> 2.3.3)
+ actionpack (3.1.8)
+ activemodel (= 3.1.8)
+ activesupport (= 3.1.8)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
- rack (~> 1.3.5)
- rack-cache (~> 1.1)
+ rack (~> 1.3.6)
+ rack-cache (~> 1.2)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.3)
- activemodel (3.1.3)
- activesupport (= 3.1.3)
+ sprockets (~> 2.0.4)
+ activemodel (3.1.8)
+ activesupport (= 3.1.8)
builder (~> 3.0.0)
i18n (~> 0.6)
- activerecord (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- arel (~> 2.2.1)
+ activerecord (3.1.8)
+ activemodel (= 3.1.8)
+ activesupport (= 3.1.8)
+ arel (~> 2.2.3)
tzinfo (~> 0.3.29)
- activeresource (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- activesupport (3.1.3)
- multi_json (~> 1.0)
+ activeresource (3.1.8)
+ activemodel (= 3.1.8)
+ activesupport (= 3.1.8)
+ activesupport (3.1.8)
+ multi_json (>= 1.0, < 1.3)
+ addressable (2.3.2)
archive-tar-minitar (0.5.2)
- arel (2.2.1)
+ arel (2.2.3)
bcrypt-ruby (3.0.1)
- bson (1.5.2)
- bson_ext (1.5.2)
- bson (= 1.5.2)
- builder (3.0.0)
- capybara (1.1.2)
+ bson (1.8.0)
+ activesupport
+ bson_ext (1.8.0)
+ bson (~> 1.8.0)
+ builder (3.0.4)
+ capybara (2.0.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
- xpath (~> 0.1.4)
- childprocess (0.2.5)
- ffi (~> 1.0.6)
+ xpath (~> 1.0.0)
+ childprocess (0.3.6)
+ ffi (~> 1.0, >= 1.0.6)
+ coderay (1.0.8)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.2.0)
+ coffee-script-source (1.4.0)
columnize (0.3.6)
- database_cleaner (0.7.0)
- devise (1.5.3)
+ database_cleaner (0.9.1)
+ devise (2.1.2)
bcrypt-ruby (~> 3.0)
- orm_adapter (~> 0.0.3)
- warden (~> 1.1)
+ orm_adapter (~> 0.1)
+ railties (~> 3.1)
+ warden (~> 1.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
- execjs (1.2.13)
+ execjs (1.4.0)
multi_json (~> 1.0)
- factory_girl (2.3.2)
- activesupport
- factory_girl_rails (1.4.0)
- factory_girl (~> 2.3.0)
+ factory_girl (4.1.0)
+ activesupport (>= 3.0.0)
+ factory_girl_rails (4.1.0)
+ factory_girl (~> 4.1.0)
railties (>= 3.0.0)
- ffi (1.0.11)
+ ffi (1.2.0)
growl (1.0.3)
- guard (0.10.0)
- ffi (>= 0.5.0)
- thor (~> 0.14.6)
- guard-rspec (0.6.0)
- guard (>= 0.10.0)
- guard-spork (0.5.0)
- guard (>= 0.10.0)
+ guard (1.6.1)
+ listen (>= 0.6.0)
+ lumberjack (>= 1.0.2)
+ pry (>= 0.9.10)
+ thor (>= 0.14.6)
+ guard-rspec (2.3.3)
+ guard (>= 1.1)
+ rspec (~> 2.11)
+ guard-spork (1.4.0)
+ childprocess (>= 0.2.3)
+ guard (>= 1.1)
spork (>= 0.8.4)
- haml (3.1.4)
- haml-rails (0.3.4)
- actionpack (~> 3.0)
- activesupport (~> 3.0)
- haml (~> 3.0)
- railties (~> 3.0)
+ haml (3.1.7)
+ haml-rails (0.3.5)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (~> 3.1)
+ railties (>= 3.1, < 4.1)
hike (1.2.1)
- hirb (0.6.0)
+ hirb (0.7.0)
hirb-unicode (0.0.5)
hirb (~> 0.5)
unicode-display_width (~> 0.1.1)
- i18n (0.6.0)
- jquery-rails (1.0.19)
- railties (~> 3.0)
- thor (~> 0.14)
- json (1.6.4)
+ i18n (0.6.1)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.7.6)
+ libwebsocket (0.1.7.1)
+ addressable
+ websocket
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
- mail (2.3.0)
+ listen (0.7.0)
+ lumberjack (1.0.2)
+ mail (2.3.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.17.2)
- mongo (1.5.2)
- bson (= 1.5.2)
- mongoid (2.4.0)
+ method_source (0.8.1)
+ mime-types (1.19)
+ mongo (1.8.0)
+ bson (~> 1.8.0)
+ mongoid (2.5.1)
activemodel (~> 3.1)
- mongo (~> 1.3)
+ mongo (~> 1.7)
tzinfo (~> 0.3.22)
- mongoid-rspec (1.4.4)
- mongoid (~> 2.0)
- rspec (~> 2)
- mongoid-tree (0.6.2)
+ mongoid-rspec (1.4.5)
+ mongoid (>= 2.4.6)
+ rake
+ rspec (>= 2.9)
+ mongoid-tree (0.7.0)
mongoid (~> 2.0)
- multi_json (1.0.4)
- nokogiri (1.5.0)
- orm_adapter (0.0.5)
+ multi_json (1.2.0)
+ nokogiri (1.5.6)
+ orm_adapter (0.4.0)
polyglot (0.3.3)
+ pry (0.9.10)
+ coderay (~> 1.0.5)
+ method_source (~> 0.8)
+ slop (~> 3.3.1)
rack (1.3.6)
- rack-cache (1.1)
+ rack-cache (1.2)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rails (3.1.3)
- actionmailer (= 3.1.3)
- actionpack (= 3.1.3)
- activerecord (= 3.1.3)
- activeresource (= 3.1.3)
- activesupport (= 3.1.3)
+ rails (3.1.8)
+ actionmailer (= 3.1.8)
+ actionpack (= 3.1.8)
+ activerecord (= 3.1.8)
+ activeresource (= 3.1.8)
+ activesupport (= 3.1.8)
bundler (~> 1.0)
- railties (= 3.1.3)
- railties (3.1.3)
- actionpack (= 3.1.3)
- activesupport (= 3.1.3)
+ railties (= 3.1.8)
+ railties (3.1.8)
+ actionpack (= 3.1.8)
+ activesupport (= 3.1.8)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
- rake (0.9.2.2)
- rb-fsevent (0.4.3.1)
+ rake (10.0.3)
+ rb-fsevent (0.9.2)
rdoc (3.12)
json (~> 1.4)
- rspec (2.8.0)
- rspec-core (~> 2.8.0)
- rspec-expectations (~> 2.8.0)
- rspec-mocks (~> 2.8.0)
- rspec-core (2.8.0)
- rspec-expectations (2.8.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.8.0)
- rspec-rails (2.8.1)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.2)
+ rspec-expectations (2.12.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.1)
+ rspec-rails (2.12.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
- rspec (~> 2.8.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -166,40 +187,42 @@ GEM
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
- rubyzip (0.9.5)
- sass (3.1.12)
- sass-rails (3.1.5)
+ rubyzip (0.9.9)
+ sass (3.2.4)
+ sass-rails (3.1.6)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
- sass (~> 3.1.10)
+ sass (>= 3.1.10)
tilt (~> 1.3.2)
- selenium-webdriver (2.16.0)
+ selenium-webdriver (2.27.2)
childprocess (>= 0.2.5)
- ffi (~> 1.0.9)
- multi_json (~> 1.0.4)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
rubyzip
- spork (0.9.0.rc9)
- sprockets (2.0.3)
+ slop (3.3.3)
+ spork (0.9.2)
+ sprockets (2.0.4)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
- treetop (1.4.10)
+ treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.31)
- uglifier (1.2.1)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
execjs (>= 0.3.0)
- multi_json (>= 1.0.2)
+ multi_json (~> 1.0, >= 1.0.2)
unicode-display_width (0.1.1)
- warden (1.1.0)
+ warden (1.2.1)
rack (>= 1.0)
webrat (0.7.3)
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
- xpath (0.1.4)
+ websocket (1.0.6)
+ xpath (1.0.0)
nokogiri (~> 1.3)
PLATFORMS
View
4 spec/lib/action_spec.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
describe Action do
- let(:skill) { Factory :skill }
- let(:belonging) { Factory :belonging }
+ let(:skill) { FactoryGirl.create :skill }
+ let(:belonging) { FactoryGirl.create :belonging }
it 'SkillクラスがActionモジュールをインクルードしていること' do
skill.is_a?(Action).should be_true
end
View
14 spec/lib/arms_spec.rb
@@ -2,10 +2,10 @@
describe Arms do
subject { Enemy }
- let(:character) { Factory :character, equip: Factory(:equip) }
- let(:enemy) { Factory :enemy }
- let(:sword) { Factory :belonging, item: Factory(:sword_item, speed: -1, add_dex: 1), character: character}
- let(:armor) { Factory :belonging, item: Factory(:armor_item, add_vit: 1), character: character}
+ let(:character) { FactoryGirl.create :character, equip: FactoryGirl.create(:equip) }
+ let(:enemy) { FactoryGirl.create :enemy }
+ let(:sword) { FactoryGirl.create :belonging, item: FactoryGirl.create(:sword_item, speed: -1, add_dex: 1), character: character}
+ let(:armor) { FactoryGirl.create :belonging, item: FactoryGirl.create(:armor_item, add_vit: 1), character: character}
before do
sword.equip
armor.equip
@@ -63,9 +63,9 @@
end
context 'Actionをセットできること' do
- let(:skill) { Factory :skill }
+ let(:skill) { FactoryGirl.create :skill }
before do
- character.assigned_skills << Factory(:assigned_skill, skill: skill)
+ character.assigned_skills << FactoryGirl.create(:assigned_skill, skill: skill)
character.action = skill
enemy.action = skill
end
@@ -73,7 +73,7 @@
it { enemy.action.should eq skill}
context 'Actionではないものをセットしたとき' do
it '例外が発生すること' do
- expect { character.action = Factory :item }.to raise_error
+ expect { character.action = FactoryGirl.create :item }.to raise_error
end
end
end
View
8 spec/lib/eretheal/formula_spec.rb
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
describe Eretheal::Formula do
- let(:character) { Factory :character, equip: Factory(:equip) }
- let(:enemy) { Factory :enemy }
- let(:sword) { Factory :belonging, item: Factory(:sword_item, speed: -1, add_dex: 1), character: character}
- let(:armor) { Factory :belonging, item: Factory(:armor_item, add_vit: 1), character: character}
+ let(:character) { FactoryGirl.create :character, equip: FactoryGirl.create(:equip) }
+ let(:enemy) { FactoryGirl.create :enemy }
+ let(:sword) { FactoryGirl.create :belonging, item: FactoryGirl.create(:sword_item, speed: -1, add_dex: 1), character: character}
+ let(:armor) { FactoryGirl.create :belonging, item: FactoryGirl.create(:armor_item, add_vit: 1), character: character}
before do
sword.equip
armor.equip
View
2  spec/lib/eretheal/response_spec.rb
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
describe Eretheal::Response do
- let(:pc) { Factory :character }
+ let(:pc) { FactoryGirl.create :character }
subject { Eretheal::Response.new(pc) }
context 'インスタンスを作成したとき' do
its(:character) { should eq pc }
View
38 spec/models/belonging_spec.rb
@@ -3,13 +3,13 @@
describe Belonging do
describe 'Belonging#equip' do
- let(:pc) { Factory :character, equip: (Factory :equip) }
+ let(:pc) { FactoryGirl.create :character, equip: (FactoryGirl.create :equip) }
let(:equip) { pc.equip }
- let(:belonging) { Factory :belonging, character: pc }
+ let(:belonging) { FactoryGirl.create :belonging, character: pc }
context '武器Aを装備したとき' do
before do
- belonging.item.item_type = Factory :sword_type
+ belonging.item.item_type = FactoryGirl.create :sword_type
belonging.item.add_dex = 1
end
it { belonging.equip.should be_true }
@@ -26,7 +26,7 @@
context '鎧Aを装備したとき' do
before do
- belonging.item.item_type = Factory :cloth_armor_type
+ belonging.item.item_type = FactoryGirl.create :cloth_armor_type
end
it { belonging.equip.should be_true }
it '鎧として装備されていること' do
@@ -37,7 +37,7 @@
context '楯Aを装備したとき' do
before do
- belonging.item.item_type = Factory :shield_type
+ belonging.item.item_type = FactoryGirl.create :shield_type
end
it { belonging.equip.should be_true }
it '楯として装備されていること' do
@@ -47,8 +47,8 @@
end
context '楯を装備している状態で2H武器を装備したとき' do
- let(:shield) { Factory(:belonging, item: Factory(:shield_item), character: equip.character) }
- let(:two_handed) { Factory(:belonging, item: Factory(:two_handed_weapon), character: equip.character) }
+ let(:shield) { FactoryGirl.create(:belonging, item: FactoryGirl.create(:shield_item), character: equip.character) }
+ let(:two_handed) { FactoryGirl.create(:belonging, item: FactoryGirl.create(:two_handed_weapon), character: equip.character) }
before do
shield.equip
two_handed.equip
@@ -62,8 +62,8 @@
end
context '2H武器の装備時に楯を装備したとき' do
- let(:shield) { Factory(:belonging, item: Factory(:shield_item), character: equip.character) }
- let(:two_handed) { Factory(:belonging, item: Factory(:two_handed_weapon), character: equip.character) }
+ let(:shield) { FactoryGirl.create(:belonging, item: FactoryGirl.create(:shield_item), character: equip.character) }
+ let(:two_handed) { FactoryGirl.create(:belonging, item: FactoryGirl.create(:two_handed_weapon), character: equip.character) }
before do
two_handed.equip
shield.equip
@@ -79,7 +79,7 @@
context '道具Aを装備したとき' do
before do
- belonging.item.item_type = Factory :item_type
+ belonging.item.item_type = FactoryGirl.create :item_type
end
it { belonging.equip.should be_false }
end
@@ -90,8 +90,8 @@
it { pc.belongings.where(_id: belonging.id).first.should be_nil }
it { pc.belongings.should have(1).removed }
end
- let(:pc) { Factory :character, equip: Factory(:equip) }
- let(:belonging) { Factory :belonging, num: 5, character: pc }
+ let(:pc) { FactoryGirl.create :character, equip: FactoryGirl.create(:equip) }
+ let(:belonging) { FactoryGirl.create :belonging, num: 5, character: pc }
context 'スタックされている所持品から1つ取り除くとき' do
before do
@@ -114,7 +114,7 @@
end
describe 'スタック不能アイテムの場合' do
- let(:belonging) { Factory :belonging, item: Factory(:unstacked_item), character: pc }
+ let(:belonging) { FactoryGirl.create :belonging, item: FactoryGirl.create(:unstacked_item), character: pc }
context 'スタック不可能アイテムから、1つ取り除くとき' do
before do
belonging.remove
@@ -122,7 +122,7 @@
it_should_behave_like '所持品オブジェクトが削除されていること'
end
context '装備している所持品を削除するとき' do
- let(:sword) { Factory :belonging, item: Factory(:sword_item), character: pc }
+ let(:sword) { FactoryGirl.create :belonging, item: FactoryGirl.create(:sword_item), character: pc }
before do
sword.equip
sword.remove
@@ -136,8 +136,8 @@
end
describe 'Belonging#equipping?' do
- let(:pc) { Factory(:character, equip: Factory(:equip)) }
- let(:belonging) { Factory :belonging, item: Factory(:sword_item), character: pc }
+ let(:pc) { FactoryGirl.create(:character, equip: FactoryGirl.create(:equip)) }
+ let(:belonging) { FactoryGirl.create :belonging, item: FactoryGirl.create(:sword_item), character: pc }
context 'ソードを装備したとき' do
before do
@@ -151,8 +151,8 @@
end
describe 'Belonging#unequip' do
- let(:pc) { Factory(:character, equip: Factory(:equip)) }
- let(:belonging) { Factory :belonging, item: Factory(:sword_item, add_dex: 1), character: pc }
+ let(:pc) { FactoryGirl.create(:character, equip: FactoryGirl.create(:equip)) }
+ let(:belonging) { FactoryGirl.create :belonging, item: FactoryGirl.create(:sword_item, add_dex: 1), character: pc }
context '装備しているソードを外すとき' do
before do
belonging.equip
@@ -169,7 +169,7 @@
it { belonging.unequip.should be_false }
end
context '装備品でないアイテムを外すとき' do
- let(:belonging) { Factory :belonging, item: Factory(:item), character: pc }
+ let(:belonging) { FactoryGirl.create :belonging, item: FactoryGirl.create(:item), character: pc }
it { belonging.unequip.should be_false }
end
end
View
48 spec/models/character_spec.rb
@@ -5,13 +5,13 @@
describe 'スタック可能アイテムAの入手機会があったとき' do
before do
- @pc = Factory :character, equip: Factory(:equip)
+ @pc = FactoryGirl.create :character, equip: FactoryGirl.create(:equip)
end
subject { @pc.belongings }
context '既にアイテムAを所持している場合' do
before do
- @pc.belongings << Factory(:belonging)
+ @pc.belongings << FactoryGirl.create(:belonging)
@item = @pc.belongings.first.item
@num = @pc.belongings.first.num
end
@@ -43,8 +43,8 @@
context 'アイテムAを所持していない場合' do
before do
- @pc.belongings << Factory(:belonging)
- @item = Factory(:item)
+ @pc.belongings << FactoryGirl.create(:belonging)
+ @item = FactoryGirl.create(:item)
end
it { should_not be_have @item }
@@ -64,7 +64,7 @@
context 'バッグが他のアイテムでいっぱいだったら' do
before do
- 5.times { @pc.belongings << Factory(:belonging) }
+ 5.times { @pc.belongings << FactoryGirl.create(:belonging) }
@pc.bag_size = 6
end
it { @pc.belongings.add(@item).should be_false }
@@ -73,7 +73,7 @@
context 'アイテムAを2個所持している場合' do
before do
- @pc.belongings << Factory(:belonging, :num => 2)
+ @pc.belongings << FactoryGirl.create(:belonging, :num => 2)
@item = @pc.belongings.first.item
end
it { should be_have @item, 2 }
@@ -81,20 +81,20 @@
context 'アイテムAを2スタックに分けて合計11個所持しているとき' do
before do
- @item = Factory :item
- @pc.belongings << Factory(:belonging, :item => @item, :num => 6)
- @pc.belongings << Factory(:belonging, :item => @item, :num => 5)
+ @item = FactoryGirl.create :item
+ @pc.belongings << FactoryGirl.create(:belonging, :item => @item, :num => 6)
+ @pc.belongings << FactoryGirl.create(:belonging, :item => @item, :num => 5)
end
it { should be_have @item, 11 }
end
end
describe 'BelongingExtension#remove' do
- let(:pc) { Factory :character, equip: Factory(:equip) }
+ let(:pc) { FactoryGirl.create :character, equip: FactoryGirl.create(:equip) }
context 'スタック可能アイテムの場合' do
- let(:item) { Factory :item }
- let(:belonging) { Factory(:belonging, item: item, num: 10) }
+ let(:item) { FactoryGirl.create :item }
+ let(:belonging) { FactoryGirl.create(:belonging, item: item, num: 10) }
before do
pc.belongings << belonging
end
@@ -106,7 +106,7 @@
context 'スタックを分けて所持しているとき' do
before do
3.times do
- pc.belongings << Factory(:belonging, item: item, num: 5)
+ pc.belongings << FactoryGirl.create(:belonging, item: item, num: 5)
end
pc.belongings.remove item, 20
end
@@ -115,11 +115,11 @@
end
context 'スタック不可能アイテムの場合' do
- let(:item) { Factory :unstacked_item }
+ let(:item) { FactoryGirl.create :unstacked_item }
subject { pc.belongings }
before do
3.times do
- pc.belongings << Factory(:belonging, item: item)
+ pc.belongings << FactoryGirl.create(:belonging, item: item)
end
subject.remove item, 2
end
@@ -128,10 +128,10 @@
end
context '装備中のアイテムが含まれている場合' do
- let(:item) { Factory :sword_item }
+ let(:item) { FactoryGirl.create :sword_item }
before do
10.times do
- pc.belongings << Factory(:belonging, item: item)
+ pc.belongings << FactoryGirl.create(:belonging, item: item)
end
pc.belongings.first.equip
@belonging_id = pc.belongings.first.id
@@ -144,12 +144,12 @@
end
describe 'BelongingExtension#have?' do
- let(:pc) { Factory :character, equip: Factory(:equip) }
- let(:item) { Factory :sword_item }
+ let(:pc) { FactoryGirl.create :character, equip: FactoryGirl.create(:equip) }
+ let(:item) { FactoryGirl.create :sword_item }
context '所持品の内一つが装備中のとき' do
before do
3.times do
- pc.belongings << Factory(:belonging, item: item)
+ pc.belongings << FactoryGirl.create(:belonging, item: item)
end
pc.belongings.first.equip
end
@@ -159,12 +159,12 @@
end
describe 'Character#action=' do
- let(:pc) { Factory :character }
- let(:skill) { Factory :skill }
- let(:belonging) { Factory :belonging }
+ let(:pc) { FactoryGirl.create :character }
+ let(:skill) { FactoryGirl.create :skill }
+ let(:belonging) { FactoryGirl.create :belonging }
context 'アサインされたスキルをセットするとき' do
before do
- pc.assigned_skills << Factory(:assigned_skill, skill: skill)
+ pc.assigned_skills << FactoryGirl.create(:assigned_skill, skill: skill)
pc.action = skill
end
it 'アクションがセットされていること' do
View
6 spec/models/equip_spec.rb
@@ -4,9 +4,9 @@
describe Equip do
context '所持品Aを武器として装備したとき' do
before do
- @pc = Factory :character
- @pc.equip = Factory :equip
- @pc.belongings << Factory(:belonging)
+ @pc = FactoryGirl.create :character
+ @pc.equip = FactoryGirl.create :equip
+ @pc.belongings << FactoryGirl.create(:belonging)
@pc.equip.weapon = @pc.belongings.first
end
it '武器と装備品は同一であること' do
View
4 spec/models/item_type_spec.rb
@@ -5,12 +5,12 @@
context 'アイテムAを装備可能かどうか診断したとき' do
subject { item }
context '装備可能なアイテムであれば' do
- let(:item) { Factory :item, :item_type => Factory(:sword_type) }
+ let(:item) { FactoryGirl.create :item, :item_type => FactoryGirl.create(:sword_type) }
its(:item_type) { should be_equip }
end
context '装備可能なアイテムでなければ' do
- let(:item) { Factory :item, :item_type => Factory(:item_type) }
+ let(:item) { FactoryGirl.create :item, :item_type => FactoryGirl.create(:item_type) }
its(:item_type) { should_not be_equip }
end
View
22 spec/models/position_spec.rb
@@ -2,9 +2,9 @@
describe Position do
describe 'Position#area' do
context '子フィールドにいるとき' do
- let(:field) { Factory(:field) }
- let(:position) { Factory :position, field: field }
- let(:node) { Factory :node_field }
+ let(:field) { FactoryGirl.create(:field) }
+ let(:position) { FactoryGirl.create :position, field: field }
+ let(:node) { FactoryGirl.create :node_field }
before do
node.children << field
end
@@ -15,13 +15,13 @@
end
describe 'Position#renew' do
- let(:field) { Factory :field }
- let(:position) { Factory :position, field: field }
- let(:parent) { Factory :field }
- let(:child) { Factory :field }
- let(:has_link) { Factory :link_field }
- let(:node) { Factory :node_field }
- let(:destination) { Factory :field, name: 'Destination' }
+ let(:field) { FactoryGirl.create :field }
+ let(:position) { FactoryGirl.create :position, field: field }
+ let(:parent) { FactoryGirl.create :field }
+ let(:child) { FactoryGirl.create :field }
+ let(:has_link) { FactoryGirl.create :link_field }
+ let(:node) { FactoryGirl.create :node_field }
+ let(:destination) { FactoryGirl.create :field, name: 'Destination' }
subject { position }
context '子フィールドへ移動したとき' do
before do
@@ -46,7 +46,7 @@
its(:area) { should eq node }
end
context 'リンクを持ったフィールドへ移動したとき' do
- let(:destination_root) { Factory :field, name: 'DestinationRoot' }
+ let(:destination_root) { FactoryGirl.create :field, name: 'DestinationRoot' }
before do
has_link.parent = parent
has_link.link = destination_root
Please sign in to comment.
Something went wrong with that request. Please try again.