spec/ravelry/pattern_spec.rb in ravelry-0.0.7 vs spec/ravelry/pattern_spec.rb in ravelry-0.0.8
- old
+ new
@@ -26,10 +26,30 @@
it 'should return a hash' do
expect(@api.data).to be_kind_of(Hash)
end
end
+ context "#permalink_get" do
+ before do
+ pattern = Ravelry::Pattern.new
+ pattern.permalink_get("traveling-woman")
+ @api = pattern
+ end
+
+ it 'should succeed' do
+ expect(@api).to be
+ end
+
+ it 'should return a pattern' do
+ expect(@api.data).to be
+ end
+
+ it 'should return a hash' do
+ expect(@api.data).to be_kind_of(Hash)
+ end
+ end
+
context '#search' do
let(:result) { Ravelry::Pattern.search('hello') }
before { stub_patterns_search }
it 'should succeed' do
@@ -62,9 +82,19 @@
expect(result).to be_kind_of(Array)
end
it 'should return an array of Patterns' do
expect(result[0]).to be_kind_of(Ravelry::Pattern)
+ end
+ end
+
+ context '#comments' do
+ before do
+ @pattern = p_initialize_paid_with_fetch
+ end
+
+ it 'creates comments' do
+ expect(@pattern.comments[0]).to be_instance_of(Ravelry::Comment)
end
end
context 'class methods' do
before do