canvas-lms/pact/spec
Ryan Shaw 4a7295c72c Include context_name in planner item response
Closes: CORE-1779

this is so we can not have to load all the possible courses on the
Student planner on page load just so we can join them to course_ids
From planner_item api responses to show course names for planner items.
Because right now, for people that have many courses it is more
Work to get all possible courses than it is to get the actual planner 
items.


Test plan:
* make a request to api/v1/planner_items, the returned
  response should include context_name and context_image for items
  That are linked to a context

Change-Id: I69f8560f19b2a46bc94915d4a9e13623b518b291
Reviewed-on: https://gerrit.instructure.com/162035
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-29 22:20:52 +00:00
..
helper spec: wiki page spec 2018-08-03 18:26:06 +00:00
README.md spec: update readme to show how to publish to broker 2018-06-19 17:04:23 +00:00
account_notifications_spec.rb spec: refactor notifications specs 2018-07-05 15:37:18 +00:00
account_reports_spec.rb spec: refactor reports specs 2018-07-05 16:41:49 +00:00
announcement_spec.rb spec: refactor announcement specs 2018-07-05 15:40:15 +00:00
assignments_spec.rb spec: fix assignment specs 2018-07-06 16:59:05 +00:00
calendar_events_spec.rb spec: refactor calender specs 2018-07-06 14:24:09 +00:00
courses_spec.rb spec: wiki page spec 2018-08-03 18:26:06 +00:00
discussions_spec.rb spec: update discussion pact spec 2018-07-19 21:37:31 +00:00
helper.rb spec: Move generic consumer tests into pact folder 2018-06-04 17:11:00 +00:00
planner_spec.rb Include context_name in planner item response 2018-08-29 22:20:52 +00:00
search_spec.rb spec: new pact api endpoint 2018-07-18 21:29:48 +00:00
user_spec.rb spec: Add authorization test 2018-07-10 20:13:42 +00:00
wiki_pages_spec.rb spec: wiki page spec 2018-08-03 18:26:06 +00:00

README.md

Canvas LMS API "Generic" Contract Tests

Normally the Pact paradigm for contract testing is such that an API consumer publishes its Pact file for the API provider to verify. Canvas LMS has multitudinous API consumers, so in order to gain the most contract test coverage possible for consumers who choose not to publish a Pact file we've created a generic API consumer called "Generic Consumer". We write the contract tests for this generic consumer in the canvas-lms repo, generate its Pact file, and verify the Pact file in the same canvas-lms repo.

To follow the normal Pact paradigm to contract test real API and Live Event consumers, see canvas-lms/spec/contracts/service_consumers/README.md.

Running the generic contract tests locally

Running the contracts tests is a simple three step process:

  1. Generate the contract(s)
  2. Share the contract(s)
  3. Verify the contract(s)

Generate the Contracts

From the canvas-lms directory, run:

bin/contracts-generate

Share the Contracts

The pact file is already placed in canvas-lms/pacts/ for you.

Verify the Contracts

To verify the Pact file, run:

bin/contracts-verify-api

All specs should pass.

Publish the pact file to broker

bin/contracts-publish-api