Skip to content

Commit

Permalink
refs #1 再コミット
Browse files Browse the repository at this point in the history
titleを必須にする
kindのデフォルトをproblemにする
  • Loading branch information
hamapu committed Sep 28, 2019
1 parent 9e29219 commit f44f7f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
ActiveRecord::Schema.define(version: 2019_09_18_012131) do

create_table "issues", force: :cascade do |t|
t.string "title"
t.string "title", null: false
t.text "body"
t.integer "kind"
t.integer "kind", default: 3
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Expand Down
16 changes: 15 additions & 1 deletion spec/requests/issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,19 @@
it { expect(response.code).to eq "200" }
it { expect(response_body.payload.body).to eq "body" }
end


describe "#01-01" do
#
end

describe "#01-02" do
let(:params) {
{ issue: { title: "title", body: "body" } }
}
before { post "/issues", params: params }
let(:response_body) { JSON.parse(response.body, object_class: OpenStruct) }
it { expect(response.code).to eq "200" }
it { expect(response_body.payload.kind).to eq "problem" }
end

end

0 comments on commit f44f7f2

Please sign in to comment.