{"action":"created","comment":{"url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/comments/30725327","id":30725327,"diff_hunk":"@@ -0,0 +1,92 @@\n+require 'rails_helper'\n+\n+RSpec.describe Activity, type: :model do\n+  describe \"Attributes\" do\n+    describe \"#high_efficiency\" do\n+      it \"has a default value of false\" do\n+        activity = Activity.new\n+        # expect([the activities high efficiency attribute]) to be false\n+        expect(activity.high_efficiency).to eq(false)\n+      end\n+    end\n+  end\n+  describe \"Validations\" do\n+    describe \"#activity_type\" do\n+      it \"does not allow nil for activity_type\" do\n+        activity = FactoryGirl.build(:activity, activity_type: nil)\n+        expect(activity.valid?).to eq(false)\n+        expect(activity.errors[:activity_type].count).to eq(1)\n+        activity.activity_type = \"shower\"\n+        expect(activity).to be_valid\n+      end\n+      \n+      it \"allows shower for activity_type\" do\n+        activity = FactoryGirl.build(:activity, activity_type: \"shower\")\n+        expect(activity.valid?).to eq(true)\n+      end\n+\n+      it \"does not allow 'foo' for activity_type\" do\n+        activity = FactoryGirl.build(:activity, activity_type: \"foo\")\n+        expect(activity).to_not be_valid\n+        expect(activity.errors[:activity_type].count).to eq(1)\n+      end\n+    end\n+\n+    describe \"#per_use\" do\n+      it \"does not allow nil\" do\n+        activity = FactoryGirl.build(:activity, per_use: nil)\n+        expect(activity).to_not be_valid\n+        expect(activity.errors[:per_use].count).to eq(1)\n+        activity.per_use = 2\n+        expect(activity).to be_valid\n+      end\n+\n+      it \"must be a number\" do\n+        activity = FactoryGirl.build(:activity, per_use: \"a\")\n+        expect(activity).to be_invalid\n+        expect(activity.errors[:per_use].count).to eq(1)\n+        activity.per_use = 2\n+        expect(activity).to be_valid\n+      end\n+    end\n+\n+    describe '#user' do\n+      it \"must be present\" do\n+        user = FactoryGirl.build(:activity, user: nil)\n+        expect(activity).to be_invalid\n+        expect(activity.errors[:user].count).to eq(1)\n+        user = User.new\n+        expect(user).to be_present        ","path":"spec/models/activity_spec.rb","position":null,"original_position":59,"commit_id":"51b2a9e2ba5a7f3007f60d6a98548a4f86e8f9fc","original_commit_id":"9559374cd323a8fbf360c5020ea39cc1523ac76a","user":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"body":"ok test is passing so only issue now is the database column i added and to check what i did and my misunderstanding on what i thought i was setting up","created_at":"2015-05-20T17:15:01Z","updated_at":"2015-05-20T17:15:01Z","html_url":"https://github.com/TeriPastorino/KnoWater/pull/8#discussion_r30725327","pull_request_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/comments/30725327"},"html":{"href":"https://github.com/TeriPastorino/KnoWater/pull/8#discussion_r30725327"},"pull_request":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8","id":35576943,"html_url":"https://github.com/TeriPastorino/KnoWater/pull/8","diff_url":"https://github.com/TeriPastorino/KnoWater/pull/8.diff","patch_url":"https://github.com/TeriPastorino/KnoWater/pull/8.patch","issue_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/8","number":8,"state":"open","locked":false,"title":"Shower log","user":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"body":"@levicole \r\nI forgot how to connect this to the issue. I think I am struggling today in general. I am dead in the water. can't figure out what to do to get test to pass. and getting mired in the factory stuff for what reason i don't know. \r\n\r\nmaybe you can give me a hint. Even though we created the let and have the information in there i did change the factory with 2 & 128oz. but neither worked. I thought I added what i needed in the controller, and added a before save callback to to the activity model. \r\n\r\ncan you help me out","created_at":"2015-05-16T20:43:11Z","updated_at":"2015-05-20T17:15:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e98b9df1306dbd2b84f5c8e86527aeb2db5f5185","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8/commits","review_comments_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8/comments","review_comment_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/8/comments","statuses_url":"https://api.github.com/repos/TeriPastorino/KnoWater/statuses/51b2a9e2ba5a7f3007f60d6a98548a4f86e8f9fc","head":{"label":"TeriPastorino:shower_log","ref":"shower_log","sha":"51b2a9e2ba5a7f3007f60d6a98548a4f86e8f9fc","user":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"repo":{"id":35171540,"name":"KnoWater","full_name":"TeriPastorino/KnoWater","owner":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TeriPastorino/KnoWater","description":"Water usage tracker and logger","fork":false,"url":"https://api.github.com/repos/TeriPastorino/KnoWater","forks_url":"https://api.github.com/repos/TeriPastorino/KnoWater/forks","keys_url":"https://api.github.com/repos/TeriPastorino/KnoWater/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TeriPastorino/KnoWater/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TeriPastorino/KnoWater/teams","hooks_url":"https://api.github.com/repos/TeriPastorino/KnoWater/hooks","issue_events_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/events{/number}","events_url":"https://api.github.com/repos/TeriPastorino/KnoWater/events","assignees_url":"https://api.github.com/repos/TeriPastorino/KnoWater/assignees{/user}","branches_url":"https://api.github.com/repos/TeriPastorino/KnoWater/branches{/branch}","tags_url":"https://api.github.com/repos/TeriPastorino/KnoWater/tags","blobs_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/refs{/sha}","trees_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TeriPastorino/KnoWater/statuses/{sha}","languages_url":"https://api.github.com/repos/TeriPastorino/KnoWater/languages","stargazers_url":"https://api.github.com/repos/TeriPastorino/KnoWater/stargazers","contributors_url":"https://api.github.com/repos/TeriPastorino/KnoWater/contributors","subscribers_url":"https://api.github.com/repos/TeriPastorino/KnoWater/subscribers","subscription_url":"https://api.github.com/repos/TeriPastorino/KnoWater/subscription","commits_url":"https://api.github.com/repos/TeriPastorino/KnoWater/commits{/sha}","git_commits_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/commits{/sha}","comments_url":"https://api.github.com/repos/TeriPastorino/KnoWater/comments{/number}","issue_comment_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/comments{/number}","contents_url":"https://api.github.com/repos/TeriPastorino/KnoWater/contents/{+path}","compare_url":"https://api.github.com/repos/TeriPastorino/KnoWater/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TeriPastorino/KnoWater/merges","archive_url":"https://api.github.com/repos/TeriPastorino/KnoWater/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TeriPastorino/KnoWater/downloads","issues_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues{/number}","pulls_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls{/number}","milestones_url":"https://api.github.com/repos/TeriPastorino/KnoWater/milestones{/number}","notifications_url":"https://api.github.com/repos/TeriPastorino/KnoWater/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TeriPastorino/KnoWater/labels{/name}","releases_url":"https://api.github.com/repos/TeriPastorino/KnoWater/releases{/id}","created_at":"2015-05-06T16:54:31Z","updated_at":"2015-05-07T19:27:48Z","pushed_at":"2015-05-20T17:14:15Z","git_url":"git://github.com/TeriPastorino/KnoWater.git","ssh_url":"git@github.com:TeriPastorino/KnoWater.git","clone_url":"https://github.com/TeriPastorino/KnoWater.git","svn_url":"https://github.com/TeriPastorino/KnoWater","homepage":null,"size":1324,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"TeriPastorino:master","ref":"master","sha":"27e69c4118aa9855a79f71980336447b2aadd80c","user":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"repo":{"id":35171540,"name":"KnoWater","full_name":"TeriPastorino/KnoWater","owner":{"login":"TeriPastorino","id":9094546,"avatar_url":"https://avatars.githubusercontent.com/u/9094546?v=3","gravatar_id":"","url":"https://api.github.com/users/TeriPastorino","html_url":"https://github.com/TeriPastorino","followers_url":"https://api.github.com/users/TeriPastorino/followers","following_url":"https://api.github.com/users/TeriPastorino/following{/other_user}","gists_url":"https://api.github.com/users/TeriPastorino/gists{/gist_id}","starred_url":"https://api.github.com/users/TeriPastorino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeriPastorino/subscriptions","organizations_url":"https://api.github.com/users/TeriPastorino/orgs","repos_url":"https://api.github.com/users/TeriPastorino/repos","events_url":"https://api.github.com/users/TeriPastorino/events{/privacy}","received_events_url":"https://api.github.com/users/TeriPastorino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TeriPastorino/KnoWater","description":"Water usage tracker and logger","fork":false,"url":"https://api.github.com/repos/TeriPastorino/KnoWater","forks_url":"https://api.github.com/repos/TeriPastorino/KnoWater/forks","keys_url":"https://api.github.com/repos/TeriPastorino/KnoWater/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TeriPastorino/KnoWater/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TeriPastorino/KnoWater/teams","hooks_url":"https://api.github.com/repos/TeriPastorino/KnoWater/hooks","issue_events_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/events{/number}","events_url":"https://api.github.com/repos/TeriPastorino/KnoWater/events","assignees_url":"https://api.github.com/repos/TeriPastorino/KnoWater/assignees{/user}","branches_url":"https://api.github.com/repos/TeriPastorino/KnoWater/branches{/branch}","tags_url":"https://api.github.com/repos/TeriPastorino/KnoWater/tags","blobs_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/refs{/sha}","trees_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TeriPastorino/KnoWater/statuses/{sha}","languages_url":"https://api.github.com/repos/TeriPastorino/KnoWater/languages","stargazers_url":"https://api.github.com/repos/TeriPastorino/KnoWater/stargazers","contributors_url":"https://api.github.com/repos/TeriPastorino/KnoWater/contributors","subscribers_url":"https://api.github.com/repos/TeriPastorino/KnoWater/subscribers","subscription_url":"https://api.github.com/repos/TeriPastorino/KnoWater/subscription","commits_url":"https://api.github.com/repos/TeriPastorino/KnoWater/commits{/sha}","git_commits_url":"https://api.github.com/repos/TeriPastorino/KnoWater/git/commits{/sha}","comments_url":"https://api.github.com/repos/TeriPastorino/KnoWater/comments{/number}","issue_comment_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/comments{/number}","contents_url":"https://api.github.com/repos/TeriPastorino/KnoWater/contents/{+path}","compare_url":"https://api.github.com/repos/TeriPastorino/KnoWater/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TeriPastorino/KnoWater/merges","archive_url":"https://api.github.com/repos/TeriPastorino/KnoWater/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TeriPastorino/KnoWater/downloads","issues_url":"https://api.github.com/repos/TeriPastorino/KnoWater/issues{/number}","pulls_url":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls{/number}","milestones_url":"https://api.github.com/repos/TeriPastorino/KnoWater/milestones{/number}","notifications_url":"https://api.github.com/repos/TeriPastorino/KnoWater/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TeriPastorino/KnoWater/labels{/name}","releases_url":"https://api.github.com/repos/TeriPastorino/KnoWater/releases{/id}","created_at":"2015-05-06T16:54:31Z","updated_at":"2015-05-07T19:27:48Z","pushed_at":"2015-05-20T17:14:15Z","git_url":"git://github.com/TeriPastorino/KnoWater.git","ssh_url":"git@github.com:TeriPastorino/KnoWater.git","clone_url":"https://github.com/TeriPastorino/KnoWater.git","svn_url":"https://github.com/TeriPastorino/KnoWater","homepage":null,"size":1324,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8"},"html":{"href":"https://github.com/TeriPastorino/KnoWater/pull/8"},"issue":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/8"},"comments":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/TeriPastorino/KnoWater/statuses/51b2a9e2ba5a7f3007f60d6a98548a4f86e8f9fc"}}}}