Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use a parent tag instead of of sub section

Only parent tags will make use of the short description(for use on the homepage), so let's reflect that in the test.
  • Loading branch information...
commit 456bead98fa03721c33745a474c201a3eb4651d7 1 parent 51de00d
Mazz Mosley mnowster authored

Showing 1 changed file with 6 additions and 7 deletions. Show diff stats Hide diff stats

  1. +6 7 test/functional/tags_controller_test.rb
13 test/functional/tags_controller_test.rb
@@ -4,22 +4,21 @@ class TagsControllerTest < ActionController::TestCase
4 4 setup do
5 5 login_as_stub_user
6 6 TagRepository.put(tag_id: "crime", title: "Crime", tag_type: "section",
7   - short_description: "A crime (or misdemeanor or felony) is an act, that a person does, which is against the laws of a country or region")
8   - TagRepository.put(tag_id: "crime/the-police", title: "The Police", tag_type: "section",
9   - short_description: "The police are a group of people whose job it is to enforce laws, help with emergencies, solve crimes and protect the public")
  7 + short_description: "Legal processes, courts and the police")
  8 + TagRepository.put(tag_id: "crime/the-police", title: "The Police", tag_type: "section")
10 9 @tag_count = 2
11 10 end
12 11
13 12 context "GET /tags/:id" do
14 13 should "return tag" do
15   - get :show, id: "crime/the-police", format: "json"
  14 + get :show, id: "crime", format: "json"
16 15 parsed = JSON.parse(response.body)
17 16 assert_response :success
18 17 assert_equal parsed["status"], "ok"
19 18 assert_equal parsed["tag"]["type"], "section"
20   - assert_equal parsed["tag"]["id"], "crime/the-police"
21   - assert_equal parsed["tag"]["title"], "The Police"
22   - assert_match /people whose job it is to enforce laws/, parsed["tag"]["short_description"]
  19 + assert_equal parsed["tag"]["id"], "crime"
  20 + assert_equal parsed["tag"]["title"], "Crime"
  21 + assert_match /Legal processes, courts and the police/, parsed["tag"]["short_description"]
23 22 end
24 23
25 24 should "return 404" do

0 comments on commit 456bead

Please sign in to comment.
Something went wrong with that request. Please try again.