spec/bearcat/client/discussions_spec.rb in bearcat-1.3.52 vs spec/bearcat/client/discussions_spec.rb in bearcat-1.3.53

- old
+ new

@@ -23,56 +23,62 @@ it 'returns course discussion topics' do stub_get(@client, "/api/v1/courses/1/discussion_topics").to_return(json_response("discussion_topics.json")) discussions = @client.course_discussions('1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 1 + discussions[0][:id].should == 1 end it 'returns group discussion topics' do stub_get(@client, "/api/v1/groups/1/discussion_topics").to_return(json_response("discussion_topics.json")) discussions = @client.group_discussions('1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 1 + discussions[0][:id].should == 1 end it 'returns course discussion entries' do stub_get(@client, "/api/v1/courses/1/discussion_topics/1/entries").to_return(json_response("discussion_entries.json")) discussions = @client.course_discussion_entries('1', '1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 1 + discussions[0][:id].should == 1 end it 'returns group discussion entries' do stub_get(@client, "/api/v1/groups/1/discussion_topics/1/entries").to_return(json_response("discussion_entries.json")) discussions = @client.group_discussion_entries('1', '1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 1 + discussions[0][:id].should == 1 end it 'returns course discussion entry replies' do stub_get(@client, "/api/v1/courses/1/discussion_topics/1/entries/1/replies").to_return(json_response("discussion_entry_replies.json")) discussions = @client.course_discussion_entry_replies('1', '1', '1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 3 + discussions[0][:id].should == 3 end it 'returns group discussion entry replies' do stub_get(@client, "/api/v1/groups/1/discussion_topics/1/entries/1/replies").to_return(json_response("discussion_entry_replies.json")) discussions = @client.group_discussion_entry_replies('1', '1', '1') discussions.class.should eq(Bearcat::ApiArray) discussions.count.should == 1 - discussions[0].class.should eq(Hash) + discussions[0].should be_a Hash discussions[0]['id'].should == 3 + discussions[0][:id].should == 3 end it 'returns a single group discussion' do stub_get(@client, "/api/v1/courses/1/discussion_topics/1").to_return(json_response("discussion_topic.json")) discussion = @client.course_discussion('1', '1')