Repository: cfpb/consumerfinance.gov

Issue:
little typo on The Bureau page
http://beta.consumerfinance.gov/the-bureau/

"Organizaitonal structure and leadership >"

should be Organizational



Discussion:

Resolving patch:
diff --git a/_lib/wordpress_post_processor.py b/_lib/wordpress_post_processor.py
--- a/_lib/wordpress_post_processor.py
+++ b/_lib/wordpress_post_processor.py
@@ -37,13 +37,13 @@ def process_post(post, newsroom = False):
         post['category'] = [cat['title'].replace('&amp;', '&') for cat in post['taxonomy_cfpb_newsroom_cat_taxonomy']]
     elif post['type'] == 'post':
         post['category'] = [cat['title'].replace('&amp;', '&') for cat in post['taxonomy_fj_category']]
-    if post['type'] == 'watchroom':
+    if post['type'] == 'featured_topic':
         post['author'] = [post['author']['name']]
-        # convert watchroom_data_x into a proper list
+        # convert featured_topic_data_x into a proper list
         links = []
         for x in xrange(0,10):
             custom_fields = post['custom_fields']
-            key = 'watchroom_data_%s_link' % x
+            key = 'featured_topic_data_%s_link' % x
             if key in custom_fields:
                 links.append(custom_fields[key])
         post['links'] = links


Test patch:
diff --git a/_tests/browser_testing/features/environment.py b/_tests/browser_testing/features/environment.py
--- a/_tests/browser_testing/features/environment.py
+++ b/_tests/browser_testing/features/environment.py
@@ -103,12 +103,12 @@ def before_all(context):
 
     # Create the mappings
     create_mapping('newsroom', os.path.join(root, '_settings/posts_mappings.json'))
-    create_mapping('watchroom', os.path.join(root, '_settings/posts_mappings.json'))
+    create_mapping('featured_topic', os.path.join(root, '_settings/posts_mappings.json'))
 
     # Index the documents
     index_documents('newsroom', os.path.join(root, '_tests/browser_testing/fixtures/newsroom.json'))
     index_documents('views', os.path.join(root, '_tests/browser_testing/fixtures/views.json'))
-    index_documents('watchroom', os.path.join(root, '_tests/browser_testing/fixtures/watchroom.json'))
+    index_documents('featured_topic', os.path.join(root, '_tests/browser_testing/fixtures/featured_topic.json'))
 
     
     
diff --git a/_tests/browser_testing/fixtures/watchroom.json b/_tests/browser_testing/fixtures/featured_topic.json
similarity index 83%
rename from _tests/browser_testing/fixtures/watchroom.json
rename to _tests/browser_testing/fixtures/featured_topic.json
--- a/_tests/browser_testing/fixtures/watchroom.json
+++ b/_tests/browser_testing/fixtures/featured_topic.json
@@ -18,15 +18,15 @@
   "excerpt": "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat [&hellip;]</p>\n",
   "id": 62449,
   "custom_fields": {
-    "watchroom_data_2": [
+    "featured_topic_data_2": [
       "http://www.facebook.com",
       "Facebook"
     ],
-    "watchroom_data_0": [
+    "featured_topic_data_0": [
       "http://www.google.com",
       "Google"
     ],
-    "watchroom_data_1": [
+    "featured_topic_data_1": [
       "http://www.yahoo.com",
       "Yahoo"
     ]
@@ -37,18 +37,18 @@
   "content": "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n",
   "comment_count": 0,
   "categories": [],
-  "type": "watchroom",
+  "type": "featured_topic",
   "status": "publish",
   "parent": 0,
   "tags": [],
   "date": "2014-07-28T16:19:46Z",
-  "slug": "who-watches-the-watchroom",
+  "slug": "who-watches-the-featured_topic",
   "comment_status": "closed",
-  "title_plain": "Who watches the watchroom",
-  "title": "Who watches the watchroom",
+  "title_plain": "Who watches the Featured Topic",
+  "title": "Who watches the Featured Topic",
   "modified": "2014-08-13 13:36:30",
   "dek": "",
-  "_id": "who-watches-the-watchroom",
+  "_id": "who-watches-the-featured_topic",
   "order": 0
 }
 ]
\ No newline at end of file
diff --git a/_tests/processor_tests/tests/test_wordpress_orgmember_processor.py b/_tests/processor_tests/tests/test_wordpress_orgmember_processor.py
--- a/_tests/processor_tests/tests/test_wordpress_orgmember_processor.py
+++ b/_tests/processor_tests/tests/test_wordpress_orgmember_processor.py
@@ -27,7 +27,7 @@ def test_orgmember(self, mock_requests_get):
                                     'test_wordpress_orgmember_processor.json')).read()
         mock_requests_get.return_value = mock_response
 
-        name = 'watchroom'
+        name = 'orgmember'
         url = 'http://mockmockmock/api/get_posts/?post_type=orgmember'
 
         documents = list(wordpress_orgmember_processor.documents(name, url))
diff --git a/_tests/processor_tests/tests/test_wordpress_post_processor.py b/_tests/processor_tests/tests/test_wordpress_post_processor.py
--- a/_tests/processor_tests/tests/test_wordpress_post_processor.py
+++ b/_tests/processor_tests/tests/test_wordpress_post_processor.py
@@ -16,7 +16,7 @@ class WordpressPostProcessorTestCase(unittest.TestCase):
     It is currently used for the types:
         post
         newsroom
-        watchroom
+        featured_topic
 
     This doesn't unittest individual functions within the module. It
     tests the `documents()` function, which is what Sheer calls, and
@@ -25,14 +25,14 @@ class WordpressPostProcessorTestCase(unittest.TestCase):
 
     @mock.patch('requests.get')
     def test_watchrooom(self, mock_requests_get):
-        # /api/get_posts/?post_type=watchroom
+        # /api/get_posts/?post_type=featured_topic
         mock_response = mock.Mock()
         mock_response.content = open(os.path.join(os.path.dirname(__file__),
-                                    'test_wordpress_post_processor_watchroom.json')).read()
+                                    'test_wordpress_post_processor_featured_topic.json')).read()
         mock_requests_get.return_value = mock_response
 
-        name = 'watchroom'
-        url = 'http://mockmockmock/api/get_posts/?post_type=watchroom'
+        name = 'featured_topic'
+        url = 'http://mockmockmock/api/get_posts/?post_type=featured_topic'
 
         documents = list(wordpress_post_processor.documents(name, url))
         document = documents[0]
diff --git a/_tests/processor_tests/tests/test_wordpress_post_processor_watchroom.json b/_tests/processor_tests/tests/test_wordpress_post_processor_featured_topic.json
similarity index 72%
rename from _tests/processor_tests/tests/test_wordpress_post_processor_watchroom.json
rename to _tests/processor_tests/tests/test_wordpress_post_processor_featured_topic.json
--- a/_tests/processor_tests/tests/test_wordpress_post_processor_watchroom.json
+++ b/_tests/processor_tests/tests/test_wordpress_post_processor_featured_topic.json
@@ -8,43 +8,43 @@
             "excerpt": "<p>Lorem ipsum dolor sit amet</p>\n", 
             "id": 1, 
             "custom_fields": {
-                "watchroom_data_0_link": [
+                "featured_topic_data_0_link": [
                     "http://somewhere/", 
                     "Testing a first link"
                 ], 
-                "watchroom_data_1_link": [
+                "featured_topic_data_1_link": [
                     "http://somewhere/", 
                     "Testing a second link"
                 ], 
-                "watchroom_data_2_link": [
+                "featured_topic_data_2_link": [
                     "http://somewhere/", 
                     "Testing a third link"
                 ],
-                "watchroom_data_3_link": [
+                "featured_topic_data_3_link": [
                     "http://somewhere/", 
                     "Testing a fourth link"
                 ],
-                "watchroom_data_4_link": [
+                "featured_topic_data_4_link": [
                     "http://somewhere/", 
                     "Testing a fifth link"
                 ],
-                "watchroom_data_5_link": [
+                "featured_topic_data_5_link": [
                     "http://somewhere/", 
                     "Testing a sixth link"
                 ],
-                "watchroom_data_6_link": [
+                "featured_topic_data_6_link": [
                     "http://somewhere/", 
                     "Testing a seventh link"
                 ],
-                "watchroom_data_7_link": [
+                "featured_topic_data_7_link": [
                     "http://somewhere/", 
                     "Testing a eighth link"
                 ],
-                "watchroom_data_8_link": [
+                "featured_topic_data_8_link": [
                     "http://somewhere/", 
                     "Testing a ninth link"
                 ],
-                "watchroom_data_9_link": [
+                "featured_topic_data_9_link": [
                     "http://somewhere/", 
                     "Testing a tenth link"
                 ]
@@ -63,16 +63,16 @@
             "content": "<p>Lorem ipsum dolor sit amet</p>\n", 
             "comment_count": 0, 
             "categories": [], 
-            "type": "watchroom", 
+            "type": "featured_topic", 
             "status": "publish", 
             "parent": 0, 
             "tags": [], 
             "date": "2014-07-28 16:19:46", 
-            "slug": "who-watches-the-watchroom", 
+            "slug": "who-watches-the-featured_topic", 
             "comment_status": "closed", 
-            "title_plain": "Who Watches the Watchroom?", 
-            "url": "http://somewhere/watchroom/who-watches-the-watchroom/", 
-            "title": "Who Watches the Watchroom?", 
+            "title_plain": "Who Watches the Featured Topic?", 
+            "url": "http://somewhere/featured_topic/who-watches-the-featured_topic/", 
+            "title": "Who Watches the Featured Topic?", 
             "modified": "2014-08-13 13:36:30", 
             "dek": "", 
             "order": 0
@@ -80,7 +80,7 @@
     ], 
     "query": {
         "count": "-1", 
-        "post_type": "watchroom", 
+        "post_type": "featured_topic", 
         "page": "1", 
         "ignore_sticky_posts": true
     },