{"action":"created","issue":{"url":"https://api.github.com/repos/Hanocha/awesome_events/issues/7","repository_url":"https://api.github.com/repos/Hanocha/awesome_events","labels_url":"https://api.github.com/repos/Hanocha/awesome_events/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Hanocha/awesome_events/issues/7/comments","events_url":"https://api.github.com/repos/Hanocha/awesome_events/issues/7/events","html_url":"https://github.com/Hanocha/awesome_events/pull/7","id":157121851,"number":7,"title":"[WIP] イベントモデルのバリデーションとそのテストを実装","user":{"login":"Hanocha","id":5087172,"avatar_url":"https://avatars.githubusercontent.com/u/5087172?v=3","gravatar_id":"","url":"https://api.github.com/users/Hanocha","html_url":"https://github.com/Hanocha","followers_url":"https://api.github.com/users/Hanocha/followers","following_url":"https://api.github.com/users/Hanocha/following{/other_user}","gists_url":"https://api.github.com/users/Hanocha/gists{/gist_id}","starred_url":"https://api.github.com/users/Hanocha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hanocha/subscriptions","organizations_url":"https://api.github.com/users/Hanocha/orgs","repos_url":"https://api.github.com/users/Hanocha/repos","events_url":"https://api.github.com/users/Hanocha/events{/privacy}","received_events_url":"https://api.github.com/users/Hanocha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-27T03:17:26Z","updated_at":"2016-05-27T03:31:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Hanocha/awesome_events/pulls/7","html_url":"https://github.com/Hanocha/awesome_events/pull/7","diff_url":"https://github.com/Hanocha/awesome_events/pull/7.diff","patch_url":"https://github.com/Hanocha/awesome_events/pull/7.patch"},"body":"# やりたいこと\r\n\r\nパRails P184にある、\r\n\r\n- name, place, start_time, end_time, contentの入力は必須\r\n- nameは50文字以下\r\n- placeは100文字以下\r\n- contentは2000文字以下\r\n- start_timeはend_timeよりも前の時間\r\n\r\nというバリデーションのテストを実装し、その後対応するテストを実装する。\r\n\r\nこれらのテストを実装するにあたって、(満を持して)shoulda-matchersを利用する。\r\nまた、モデルのレコードがある前提のテストを記述する際に便利なfactory-girlも使用する。\r\n\r\n# やること\r\n\r\n- [x] shoulda-matchersをインストール\r\n- [ ] 必須項目チェックに関するテストを記述\r\n- [ ] 必須項目チェックのバリデーションを記述\r\n- [ ] 必須項目チェックのテストが通ることを確認\r\n- [ ] nameの制約に関するテストとバリデーションの実装、確認\r\n- [ ] placeの制約に関するテストとバリデーションの実装、確認\r\n- [ ] contentの制約に関するテストとバリデーションの実装、確認\r\n- [ ] start_timeとend_timeの制約に関するテストとバリデーションの実装、確認"},"comment":{"url":"https://api.github.com/repos/Hanocha/awesome_events/issues/comments/222052236","html_url":"https://github.com/Hanocha/awesome_events/pull/7#issuecomment-222052236","issue_url":"https://api.github.com/repos/Hanocha/awesome_events/issues/7","id":222052236,"user":{"login":"Hanocha","id":5087172,"avatar_url":"https://avatars.githubusercontent.com/u/5087172?v=3","gravatar_id":"","url":"https://api.github.com/users/Hanocha","html_url":"https://github.com/Hanocha","followers_url":"https://api.github.com/users/Hanocha/followers","following_url":"https://api.github.com/users/Hanocha/following{/other_user}","gists_url":"https://api.github.com/users/Hanocha/gists{/gist_id}","starred_url":"https://api.github.com/users/Hanocha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hanocha/subscriptions","organizations_url":"https://api.github.com/users/Hanocha/orgs","repos_url":"https://api.github.com/users/Hanocha/repos","events_url":"https://api.github.com/users/Hanocha/events{/privacy}","received_events_url":"https://api.github.com/users/Hanocha/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T03:31:26Z","updated_at":"2016-05-27T03:31:26Z","body":"```\r\n  1) Event#name\r\n     Failure/Error: it { should validate_presence_of(:name) }\r\n\r\n     NoMethodError:\r\n       undefined method `validate_presence_of' for #<RSpec::ExampleGroups::Event::Name:0x007fa3af7bb088>\r\n     # ./spec/models/event_spec.rb:5:in `block (3 levels) in <top (required)>'\r\n\r\n  2) Event#name\r\n     Failure/Error: it { should ensure_length_of(:name).is_at_most(50) }\r\n\r\n     NoMethodError:\r\n       undefined method `ensure_length_of' for #<RSpec::ExampleGroups::Event::Name:0x007fa3aed6b5b0>\r\n     # ./spec/models/event_spec.rb:6:in `block (3 levels) in <top (required)>'\r\n```"}}
{"actor":{"display_login":"Hanocha"}}