{"action":"created","comment":{"url":"https://api.github.com/repos/kuranovandry/app3/pulls/comments/32226948","id":32226948,"diff_hunk":"@@ -0,0 +1,39 @@\n+require 'rails_helper'\n+\n+RSpec.describe Ticket, type: :model do\n+  describe 'association' do\n+    it { is_expected.to belong_to(:movie) }\n+    it { is_expected.to have_many(:cart_items) }\n+    it { is_expected.to have_many(:order_items) }\n+  end\n+\n+  describe 'validations' do\n+    it 'has valid factory' do\n+      expect(build(:ticket)).to be_valid\n+    end\n+\n+    it { is_expected.to validate_presence_of(:movie) }\n+    it { is_expected.to validate_presence_of(:price) }\n+    it { is_expected.to validate_presence_of(:place_number) }\n+    it { is_expected.to validate_numericality_of(:place_number).is_greater_than(0).only_integer }\n+    it { is_expected.to validate_numericality_of(:price).is_greater_than(0) }\n+    it { is_expected.to validate_uniqueness_of(:place_number) }\n+  end\n+\n+  describe '.available_tickets' do\n+    let(:movie) { create :movie }\n+    let(:first_ticket) { Ticket.first }","path":"spec/models/ticket_spec.rb","position":25,"original_position":25,"commit_id":"b4009ed4a012911587b69088c04235df560a2e3b","original_commit_id":"b4009ed4a012911587b69088c04235df560a2e3b","user":{"login":"MaximSt","id":402178,"avatar_url":"https://avatars.githubusercontent.com/u/402178?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximSt","html_url":"https://github.com/MaximSt","followers_url":"https://api.github.com/users/MaximSt/followers","following_url":"https://api.github.com/users/MaximSt/following{/other_user}","gists_url":"https://api.github.com/users/MaximSt/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximSt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximSt/subscriptions","organizations_url":"https://api.github.com/users/MaximSt/orgs","repos_url":"https://api.github.com/users/MaximSt/repos","events_url":"https://api.github.com/users/MaximSt/events{/privacy}","received_events_url":"https://api.github.com/users/MaximSt/received_events","type":"User","site_admin":false},"body":"create ticket here with all necessary attributes","created_at":"2015-06-11T14:36:28Z","updated_at":"2015-06-11T14:36:28Z","html_url":"https://github.com/kuranovandry/app3/pull/36#discussion_r32226948","pull_request_url":"https://api.github.com/repos/kuranovandry/app3/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/comments/32226948"},"html":{"href":"https://github.com/kuranovandry/app3/pull/36#discussion_r32226948"},"pull_request":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/kuranovandry/app3/pulls/36","id":37254929,"html_url":"https://github.com/kuranovandry/app3/pull/36","diff_url":"https://github.com/kuranovandry/app3/pull/36.diff","patch_url":"https://github.com/kuranovandry/app3/pull/36.patch","issue_url":"https://api.github.com/repos/kuranovandry/app3/issues/36","number":36,"state":"open","locked":false,"title":"Add buy ticket logic and tests to it.","user":{"login":"bodikqlar","id":7132047,"avatar_url":"https://avatars.githubusercontent.com/u/7132047?v=3","gravatar_id":"","url":"https://api.github.com/users/bodikqlar","html_url":"https://github.com/bodikqlar","followers_url":"https://api.github.com/users/bodikqlar/followers","following_url":"https://api.github.com/users/bodikqlar/following{/other_user}","gists_url":"https://api.github.com/users/bodikqlar/gists{/gist_id}","starred_url":"https://api.github.com/users/bodikqlar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bodikqlar/subscriptions","organizations_url":"https://api.github.com/users/bodikqlar/orgs","repos_url":"https://api.github.com/users/bodikqlar/repos","events_url":"https://api.github.com/users/bodikqlar/events{/privacy}","received_events_url":"https://api.github.com/users/bodikqlar/received_events","type":"User","site_admin":false},"body":"Add prawn gem for pdf download.","created_at":"2015-06-09T13:49:53Z","updated_at":"2015-06-11T14:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"424672045dd7872da829a0ea0fa421036a009551","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kuranovandry/app3/pulls/36/commits","review_comments_url":"https://api.github.com/repos/kuranovandry/app3/pulls/36/comments","review_comment_url":"https://api.github.com/repos/kuranovandry/app3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kuranovandry/app3/issues/36/comments","statuses_url":"https://api.github.com/repos/kuranovandry/app3/statuses/b4009ed4a012911587b69088c04235df560a2e3b","head":{"label":"kuranovandry:ft/buying_logic","ref":"ft/buying_logic","sha":"b4009ed4a012911587b69088c04235df560a2e3b","user":{"login":"kuranovandry","id":6107851,"avatar_url":"https://avatars.githubusercontent.com/u/6107851?v=3","gravatar_id":"","url":"https://api.github.com/users/kuranovandry","html_url":"https://github.com/kuranovandry","followers_url":"https://api.github.com/users/kuranovandry/followers","following_url":"https://api.github.com/users/kuranovandry/following{/other_user}","gists_url":"https://api.github.com/users/kuranovandry/gists{/gist_id}","starred_url":"https://api.github.com/users/kuranovandry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuranovandry/subscriptions","organizations_url":"https://api.github.com/users/kuranovandry/orgs","repos_url":"https://api.github.com/users/kuranovandry/repos","events_url":"https://api.github.com/users/kuranovandry/events{/privacy}","received_events_url":"https://api.github.com/users/kuranovandry/received_events","type":"User","site_admin":false},"repo":{"id":34514698,"name":"app3","full_name":"kuranovandry/app3","owner":{"login":"kuranovandry","id":6107851,"avatar_url":"https://avatars.githubusercontent.com/u/6107851?v=3","gravatar_id":"","url":"https://api.github.com/users/kuranovandry","html_url":"https://github.com/kuranovandry","followers_url":"https://api.github.com/users/kuranovandry/followers","following_url":"https://api.github.com/users/kuranovandry/following{/other_user}","gists_url":"https://api.github.com/users/kuranovandry/gists{/gist_id}","starred_url":"https://api.github.com/users/kuranovandry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuranovandry/subscriptions","organizations_url":"https://api.github.com/users/kuranovandry/orgs","repos_url":"https://api.github.com/users/kuranovandry/repos","events_url":"https://api.github.com/users/kuranovandry/events{/privacy}","received_events_url":"https://api.github.com/users/kuranovandry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kuranovandry/app3","description":"","fork":false,"url":"https://api.github.com/repos/kuranovandry/app3","forks_url":"https://api.github.com/repos/kuranovandry/app3/forks","keys_url":"https://api.github.com/repos/kuranovandry/app3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuranovandry/app3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuranovandry/app3/teams","hooks_url":"https://api.github.com/repos/kuranovandry/app3/hooks","issue_events_url":"https://api.github.com/repos/kuranovandry/app3/issues/events{/number}","events_url":"https://api.github.com/repos/kuranovandry/app3/events","assignees_url":"https://api.github.com/repos/kuranovandry/app3/assignees{/user}","branches_url":"https://api.github.com/repos/kuranovandry/app3/branches{/branch}","tags_url":"https://api.github.com/repos/kuranovandry/app3/tags","blobs_url":"https://api.github.com/repos/kuranovandry/app3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuranovandry/app3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuranovandry/app3/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuranovandry/app3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuranovandry/app3/statuses/{sha}","languages_url":"https://api.github.com/repos/kuranovandry/app3/languages","stargazers_url":"https://api.github.com/repos/kuranovandry/app3/stargazers","contributors_url":"https://api.github.com/repos/kuranovandry/app3/contributors","subscribers_url":"https://api.github.com/repos/kuranovandry/app3/subscribers","subscription_url":"https://api.github.com/repos/kuranovandry/app3/subscription","commits_url":"https://api.github.com/repos/kuranovandry/app3/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuranovandry/app3/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuranovandry/app3/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuranovandry/app3/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuranovandry/app3/contents/{+path}","compare_url":"https://api.github.com/repos/kuranovandry/app3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuranovandry/app3/merges","archive_url":"https://api.github.com/repos/kuranovandry/app3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuranovandry/app3/downloads","issues_url":"https://api.github.com/repos/kuranovandry/app3/issues{/number}","pulls_url":"https://api.github.com/repos/kuranovandry/app3/pulls{/number}","milestones_url":"https://api.github.com/repos/kuranovandry/app3/milestones{/number}","notifications_url":"https://api.github.com/repos/kuranovandry/app3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuranovandry/app3/labels{/name}","releases_url":"https://api.github.com/repos/kuranovandry/app3/releases{/id}","created_at":"2015-04-24T11:20:38Z","updated_at":"2015-05-08T12:15:02Z","pushed_at":"2015-06-11T14:10:21Z","git_url":"git://github.com/kuranovandry/app3.git","ssh_url":"git@github.com:kuranovandry/app3.git","clone_url":"https://github.com/kuranovandry/app3.git","svn_url":"https://github.com/kuranovandry/app3","homepage":null,"size":7008,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"kuranovandry:master","ref":"master","sha":"27e486ffcef545f9d65cf4067febc6c8102a8563","user":{"login":"kuranovandry","id":6107851,"avatar_url":"https://avatars.githubusercontent.com/u/6107851?v=3","gravatar_id":"","url":"https://api.github.com/users/kuranovandry","html_url":"https://github.com/kuranovandry","followers_url":"https://api.github.com/users/kuranovandry/followers","following_url":"https://api.github.com/users/kuranovandry/following{/other_user}","gists_url":"https://api.github.com/users/kuranovandry/gists{/gist_id}","starred_url":"https://api.github.com/users/kuranovandry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuranovandry/subscriptions","organizations_url":"https://api.github.com/users/kuranovandry/orgs","repos_url":"https://api.github.com/users/kuranovandry/repos","events_url":"https://api.github.com/users/kuranovandry/events{/privacy}","received_events_url":"https://api.github.com/users/kuranovandry/received_events","type":"User","site_admin":false},"repo":{"id":34514698,"name":"app3","full_name":"kuranovandry/app3","owner":{"login":"kuranovandry","id":6107851,"avatar_url":"https://avatars.githubusercontent.com/u/6107851?v=3","gravatar_id":"","url":"https://api.github.com/users/kuranovandry","html_url":"https://github.com/kuranovandry","followers_url":"https://api.github.com/users/kuranovandry/followers","following_url":"https://api.github.com/users/kuranovandry/following{/other_user}","gists_url":"https://api.github.com/users/kuranovandry/gists{/gist_id}","starred_url":"https://api.github.com/users/kuranovandry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuranovandry/subscriptions","organizations_url":"https://api.github.com/users/kuranovandry/orgs","repos_url":"https://api.github.com/users/kuranovandry/repos","events_url":"https://api.github.com/users/kuranovandry/events{/privacy}","received_events_url":"https://api.github.com/users/kuranovandry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kuranovandry/app3","description":"","fork":false,"url":"https://api.github.com/repos/kuranovandry/app3","forks_url":"https://api.github.com/repos/kuranovandry/app3/forks","keys_url":"https://api.github.com/repos/kuranovandry/app3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuranovandry/app3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuranovandry/app3/teams","hooks_url":"https://api.github.com/repos/kuranovandry/app3/hooks","issue_events_url":"https://api.github.com/repos/kuranovandry/app3/issues/events{/number}","events_url":"https://api.github.com/repos/kuranovandry/app3/events","assignees_url":"https://api.github.com/repos/kuranovandry/app3/assignees{/user}","branches_url":"https://api.github.com/repos/kuranovandry/app3/branches{/branch}","tags_url":"https://api.github.com/repos/kuranovandry/app3/tags","blobs_url":"https://api.github.com/repos/kuranovandry/app3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuranovandry/app3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuranovandry/app3/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuranovandry/app3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuranovandry/app3/statuses/{sha}","languages_url":"https://api.github.com/repos/kuranovandry/app3/languages","stargazers_url":"https://api.github.com/repos/kuranovandry/app3/stargazers","contributors_url":"https://api.github.com/repos/kuranovandry/app3/contributors","subscribers_url":"https://api.github.com/repos/kuranovandry/app3/subscribers","subscription_url":"https://api.github.com/repos/kuranovandry/app3/subscription","commits_url":"https://api.github.com/repos/kuranovandry/app3/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuranovandry/app3/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuranovandry/app3/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuranovandry/app3/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuranovandry/app3/contents/{+path}","compare_url":"https://api.github.com/repos/kuranovandry/app3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuranovandry/app3/merges","archive_url":"https://api.github.com/repos/kuranovandry/app3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuranovandry/app3/downloads","issues_url":"https://api.github.com/repos/kuranovandry/app3/issues{/number}","pulls_url":"https://api.github.com/repos/kuranovandry/app3/pulls{/number}","milestones_url":"https://api.github.com/repos/kuranovandry/app3/milestones{/number}","notifications_url":"https://api.github.com/repos/kuranovandry/app3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuranovandry/app3/labels{/name}","releases_url":"https://api.github.com/repos/kuranovandry/app3/releases{/id}","created_at":"2015-04-24T11:20:38Z","updated_at":"2015-05-08T12:15:02Z","pushed_at":"2015-06-11T14:10:21Z","git_url":"git://github.com/kuranovandry/app3.git","ssh_url":"git@github.com:kuranovandry/app3.git","clone_url":"https://github.com/kuranovandry/app3.git","svn_url":"https://github.com/kuranovandry/app3","homepage":null,"size":7008,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/36"},"html":{"href":"https://github.com/kuranovandry/app3/pull/36"},"issue":{"href":"https://api.github.com/repos/kuranovandry/app3/issues/36"},"comments":{"href":"https://api.github.com/repos/kuranovandry/app3/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kuranovandry/app3/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/kuranovandry/app3/statuses/b4009ed4a012911587b69088c04235df560a2e3b"}}}}