spec/lib/azeroth/resource_builder_spec.rb in azeroth-0.0.4 vs spec/lib/azeroth/resource_builder_spec.rb in azeroth-0.0.5

- old
+ new

@@ -1,16 +1,18 @@ +# frozen_string_literal: true + require 'spec_helper' describe Azeroth::ResourceBuilder do - subject { described_class.new(model, builder) } + subject(:resource_builder) { described_class.new(model, builder) } let(:model) { Azeroth::Model.new(:document) } let(:builder) { Sinclair.new(klass) } let(:klass) { Class.new(ResourceBuilderController) } before do - subject.append + resource_builder.append 10.times { Document.create } end describe '#append' do it 'adds the listing method' do @@ -23,10 +25,10 @@ expect { builder.build } .to change { klass.new.respond_to?(:document) } .to(true) end - context 'after the build' do + describe 'after the build' do let(:controller) { klass.new(document_id: document.id) } let(:document) { Document.create } before { builder.build }