spec/models/match_spec.rb in synchronisable-1.0.2 vs spec/models/match_spec.rb in synchronisable-1.0.3
- old
+ new
@@ -13,29 +13,28 @@
it { is_expected.to change { MatchPlayer.count }.by(4) }
it { is_expected.to change { Synchronisable::Import.count }.by(11) }
end
- # TODO: Left here until :include option is implemented
- #
- # context 'when associations specified with :include option' do
- # subject do
- # -> { sync_match }
- # end
+ context 'when associations specified with :includes option' do
+ subject do
+ -> { sync_match }
+ end
- # def sync_match
- # Match.sync(:include => {
- # :match => {
- # :team => :players
- # }
- # })
- # end
+ def sync_match
+ Match.sync(:includes => {
+ :team => :players,
+ :blha => {
+ :x => :z,
+ :y => :f
+ }
+ })
+ end
- # it { is_expected.to change { Match.count }.by(1) }
- # it { is_expected.to change { Team.count }.by(2) }
- # it { is_expected.to change { Player.count }.by(22) }
- # it { is_expected.to change { MatchPlayer.count }.by(22) }
+ it { is_expected.to change { Match.count }.by(1) }
+ it { is_expected.to change { Team.count }.by(2) }
+ it { is_expected.to change { Player.count }.by(4) }
- # it { is_expected.to change { Synchronisable::Import.count }.by(47) }
- # end
+ it { is_expected.to change { Synchronisable::Import.count }.by(7) }
+ end
end
end