Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Edit the integration test

  • Loading branch information...
commit 492ce1fe965fc6906e5b4549dc36fb4bba43594b 1 parent 5d78b2e
@kyungbae kyungbae authored
View
4 spec/factories/item_relations.rb
@@ -29,5 +29,9 @@
trait :with_comment do
association :itemable, factory: :comment
end
+
+ trait :with_contribution_request do
+ association :itemable, factory: :contribution_request
+ end
end
end
View
18 spec/requests/activity_info_request_spec.rb
@@ -4,13 +4,17 @@
let!(:item) { create(:item, accession_no: '1253A24') }
# Create multiple activities with an item
- let!(:item_related_questions) { create_list(:item_relation, 4, item: item) }
- let!(:item_related_discussions) { create_list(:item_relation, 6, :with_discussion, item: item) }
- let!(:item_related_researches) { create_list(:item_relation, 2, :with_research, item: item) }
- let!(:item_related_translations) { create_list(:item_relation, 5, :with_translation, item: item) }
- let!(:item_related_transcriptions) { create_list(:item_relation, 1, :with_transcription, item: item) }
- let!(:item_related_biographies) { create_list(:item_relation, 3, :with_biography, item: item) }
- let!(:item_related_comments) { create_list(:item_relation, 7, :with_comment, item: item) }
+ let!(:item_related_questions) { create_list(:item_relation, 4, item: item) }
+ let!(:item_related_discussions) { create_list(:item_relation, 6, :with_discussion, item: item) }
+ let!(:item_related_researches) { create_list(:item_relation, 2, :with_research, item: item) }
+ let!(:item_related_translations) { create_list(:item_relation, 5, :with_translation, item: item) }
+ let!(:item_related_transcriptions) { create_list(:item_relation, 1, :with_transcription, item: item) }
+ let!(:item_related_biographies) { create_list(:item_relation, 3, :with_biography, item: item) }
+ let!(:item_related_comments) { create_list(:item_relation, 7, :with_comment, item: item) }
+
+ # Creating a contribution request is not considered as an activity. Also, it
+ # should not change any activity counts.
+ let!(:item_related_contribution_request) { create_list(:item_relation, 8, :with_contribution_request, item: item) }
# Make a request for the activity data in json format
before { get '/activity/activity_data?accession_no=1253A24', :format => :json }
Please sign in to comment.
Something went wrong with that request. Please try again.