Create topics with tags

Create topics with tags

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ba90aa0..c52c566 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).
 
+## [0.42.0] - 2020-07-09
+### Added
+- Create topics with tags
+
 ## [0.41.0] - 2020-06-17
 ### Added
 - Add basic auth support
diff --git a/examples/create_topic.rb b/examples/create_topic.rb
index 6d3f6d1..42e1970 100644
--- a/examples/create_topic.rb
+++ b/examples/create_topic.rb
@@ -24,3 +24,13 @@ client.create_topic(
   title: "Your Favorite Color?",
   raw: "[poll name=color]\n- Green\n- Blue\n- Red\n[/poll]"
 )
+
+# Create Topic with Tags
+client.create_topic(
+  category: 1,
+  skip_validations: true,
+  auto_track: false,
+  title: "Concert Master: A new way to choose",
+  raw: "This is the raw markdown for my post"
+  tags: ['asdf', 'fdsa']
+)
diff --git a/lib/discourse_api/api/topics.rb b/lib/discourse_api/api/topics.rb
index ac63f42..4d2b6f5 100644
--- a/lib/discourse_api/api/topics.rb
+++ b/lib/discourse_api/api/topics.rb
@@ -9,7 +9,7 @@ module DiscourseApi
       def create_topic(args = {})
         args = API.params(args)
           .required(:title, :raw)
-          .optional(:skip_validations, :category, :auto_track, :created_at, :api_username)
+          .optional(:skip_validations, :category, :auto_track, :created_at, :api_username, :tags)
         post("/posts", args.to_h)
       end
 
diff --git a/lib/discourse_api/version.rb b/lib/discourse_api/version.rb
index bbb9c7b..da154b5 100644
--- a/lib/discourse_api/version.rb
+++ b/lib/discourse_api/version.rb
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 module DiscourseApi
-  VERSION = "0.41.0"
+  VERSION = "0.42.0"
 end
diff --git a/spec/discourse_api/api/topics_spec.rb b/spec/discourse_api/api/topics_spec.rb
index 4554b96..b73650c 100644
--- a/spec/discourse_api/api/topics_spec.rb
+++ b/spec/discourse_api/api/topics_spec.rb
@@ -148,4 +148,22 @@ describe DiscourseApi::API::Topics do
       expect(body['post_stream']['posts'].first).to be_a Hash
     end
   end
+
+  describe "#create_topic_with_tags" do
+    before do
+      stub_post("#{host}/posts").to_return(body: fixture("create_topic_with_tags.json"), headers: { content_type: "application/json" })
+    end
+
+    it "makes the post request" do
+      subject.create_topic title: "Sample Topic Title", raw: "Sample topic content body", tags: ["asdf", "fdsa"]
+      expect(a_post("#{host}/posts")).to have_been_made
+    end
+
+    it "returns success" do
+      response = subject.create_topic title: "Sample Topic Title", raw: "Sample topic content body", tags: ["asdf", "fdsa"]
+      expect(response).to be_a Hash
+      expect(response['topic_id']).to eq 21
+    end
+  end
+
 end
diff --git a/spec/fixtures/create_topic_with_tags.json b/spec/fixtures/create_topic_with_tags.json
new file mode 100644
index 0000000..5352ebd
--- /dev/null
+++ b/spec/fixtures/create_topic_with_tags.json
@@ -0,0 +1,65 @@
+{
+  "id": 29,
+  "name": null,
+  "username": "blake",
+  "avatar_template": "/user_avatar/localhost/blake/{size}/3_2.png",
+  "created_at": "2020-07-09T15:52:43.802Z",
+  "cooked": "<p>cb8ee24eb3c5a81139958cf2b6bee9bd 2a7f7ea218e24c9ee6528cd383527f99 5a3006b92918946230385393a83b6005</p>",
+  "post_number": 1,
+  "post_type": 1,
+  "updated_at": "2020-07-09T15:52:43.802Z",
+  "reply_count": 0,
+  "reply_to_post_number": null,
+  "quote_count": 0,
+  "incoming_link_count": 0,
+  "reads": 0,
+  "readers_count": 0,
+  "score": 0,
+  "yours": true,
+  "topic_id": 21,
+  "topic_slug": "1412a036bfe-6480718525e-9f71f98ef46",
+  "display_username": null,
+  "primary_group_name": null,
+  "primary_group_flair_url": null,
+  "primary_group_flair_bg_color": null,
+  "primary_group_flair_color": null,
+  "version": 1,
+  "can_edit": true,
+  "can_delete": false,
+  "can_recover": false,
+  "can_wiki": true,
+  "user_title": null,
+  "actions_summary": [
+    {
+      "id": 3,
+      "can_act": true
+    },
+    {
+      "id": 4,
+      "can_act": true
+    },
+    {
+      "id": 8,
+      "can_act": true
+    },
+    {
+      "id": 7,
+      "can_act": true
+    }
+  ],
+  "moderator": false,
+  "admin": true,
+  "staff": true,
+  "user_id": 1,
+  "draft_sequence": 0,
+  "hidden": false,
+  "trust_level": 1,
+  "deleted_at": null,
+  "user_deleted": false,
+  "edit_reason": null,
+  "can_view_edit_history": true,
+  "wiki": false,
+  "reviewable_id": null,
+  "reviewable_score_count": 0,
+  "reviewable_score_pending_count": 0
+}

GitHub sha: 020eafeb