{"action":"created","comment":{"url":"https://api.github.com/repos/smashingboxes/guides/pulls/comments/41408431","id":41408431,"diff_hunk":"@@ -0,0 +1,226 @@\n+# General formatting\n+\n+## Ruby styling\n+\n+Firstly, when writing ruby, follow the [backend's ruby style guide](http://wiki.smashingboxes.com/articles/backend)\n+\n+## Feature files\n+\n+Each feature file should have the following format:\n+\n+````cucumber\n+Feature: <feature name>\n+\n+  As a ...\n+  I want to ...\n+  So that ...\n+\n+  Background:\n+    Given ...\n+      And ...\n+\n+  Scenario: <scenario 1 name>\n+    Given ...\n+      And ...\n+    When ...\n+      And ...\n+    Then ...\n+      And ...\n+\n+  Scenario: <scenario 2 name>\n+    ...\n+````\n+\n+Things to note here:\n+- A user story should be included at the top. The format should match the project's preference.\n+- Any `Given` statements that are common to all scenarios in the feature should be included under `Background`\n+- Indent `And` statements below their parent `Given`, `When`, or `Then`\n+\n+## Step definition files\n+\n+1. Matchers are be grouped by step type (`Given`, `When`, `Then`)\n+2. Matchers with complex regexes have example comments\n+3. The matcher is short\n+5. The matcher has at most two valuable parameters\n+6. The parameter variables are clearly named\n+7. The body is less than ten lines of code\n+8. The body does not call other steps\n+\n+````ruby\n+# I am logged in as a \"user\"\n+# I am logged in as an \"admin\"\n+Given /^I am logged in as an? \"([^\"]*)\"$/i do |role|\n+  log_in(role)\n+end\n+\n+# <remaining Given statements>\n+\n+When /^I create a product$/ do |form|\n+  @product = create_product\n+end\n+\n+# <remaining When statements>\n+\n+# I see the product\n+Then /^I see the product$/ do ||\n+  expect(page).to have_content(@product.title)\n+end\n+\n+# <remaining Then statements>\n+````\n+\n+# File organization\n+\n+Feature files should be grouped into directories based on site\n+functionality. Keep in mind that with cucumber you can run a group of tests by\n+giving a directory name (`cucumber feature/admin/` will test all the admin\n+features).\n+\n+Step definitions should be grouped [by domain\n+concept](https://github.com/cucumber/cucumber/wiki/Step-Organization). If you're\n+familiar with Rails terminology, a domain concept would be equivalent to a Rails\n+model.\n+\n+For example, if we have an app for managing classes in a school, the cucumber\n+files might be organized like this:\n+\n+````\n+feature\n+|-- admin\n+|  `-- login.feature\n+|  `-- users.feature\n+|  `-- classes.feature\n+|-- class_list\n+|  `-- search.feature\n+|  `-- filters.feature\n+|-- registration\n+|  `-- tuition.feature\n+|  `-- classes.feature\n+|-- step_definitions\n+|  `-- general_steps.rb\n+|  `-- teacher_steps.rb\n+|  `-- student_steps.rb\n+|  `-- class_steps.rb\n+|  `-- bill_steps.rb\n+`-- support\n+````\n+\n+# Other rules\n+\n+## Write features from the user's perspective\n+\n+### Bad\n+\n+````cucumber\n+Given a user is logged in\n+When the user clicks \"something\"\n+Then the user sees \"something\"\n+````\n+\n+### Good\n+\n+````cucumber\n+Given I am logged in\n+When I click \"something\"\n+Then the user sees\n+````\n+\n+## Write feature steps in the present tense\n+\n+### Bad\n+\n+````cucumber\n+Given I logged into the site\n+When I have clicked \"something\"\n+Then I saw \"something\"\n+````\n+\n+### Good\n+\n+````cucumber\n+Given I am logged into the site\n+When I click \"something\"\n+Then I see \"something\"\n+````\n+\n+## Don't use \"should\"\n+\n+### Bad\n+\n+````\n+# *.feature\n+Then I should see \"the thing\"\n+\n+# *_steps.rb\n+page.should have_content(\"the thing\")\n+````\n+\n+### Good\n+\n+````\n+# *.feature\n+Then I see \"the thing\"\n+\n+# *_steps.rb\n+expect(page).to have_content(\"the thing\")\n+````\n+\n+## Use declarative style scenarios\n+\n+### Bad\n+````cucumber\n+Story: Animal Submission\n+\n+  As a Zoologist\n+  I want to add a new animal to the site\n+  So that I can share my animal knowledge with the community\n+\n+  Scenario: successful submission\n+    Given I'm on the animal creation page\n+\n+    When I fill in Name with 'Alligator'\n+    And select Phylum as 'Chordata'\n+    And fill in Animal Class with 'Sauropsida'\n+    And fill in Order with 'Crocodilia'\n+    And fill in Family with 'Alligatoridae'\n+    And fill in Genus with 'Alligator'\n+    And check Lay Eggs\n+    And click the Create button\n+\n+    Then I should see the notice 'Thank you for your animal submission!'\n+    And the page should include the animal's name, phylum, animal class, order, family, and genus\n+````\n+\n+### Good\n+\n+````cucumber\n+Story: Animal Submission\n+\n+  As a Zoologist\n+  I want to add a new animal to the site\n+  So that I can share my animal knowledge with the community\n+\n+  Scenario: successful submission\n+  Given I'm on the animal creation page","path":"qa/cucumber.md","position":204,"original_position":204,"commit_id":"8e675e5e31ffc835130f49efec37356456a13733","original_commit_id":"8e675e5e31ffc835130f49efec37356456a13733","user":{"login":"dkniffin","id":1680080,"avatar_url":"https://avatars.githubusercontent.com/u/1680080?v=3","gravatar_id":"","url":"https://api.github.com/users/dkniffin","html_url":"https://github.com/dkniffin","followers_url":"https://api.github.com/users/dkniffin/followers","following_url":"https://api.github.com/users/dkniffin/following{/other_user}","gists_url":"https://api.github.com/users/dkniffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dkniffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkniffin/subscriptions","organizations_url":"https://api.github.com/users/dkniffin/orgs","repos_url":"https://api.github.com/users/dkniffin/repos","events_url":"https://api.github.com/users/dkniffin/events{/privacy}","received_events_url":"https://api.github.com/users/dkniffin/received_events","type":"User","site_admin":false},"body":"Yep, thanks. I copy pasted that, but it should definitely follow the other rules.","created_at":"2015-10-07T15:56:43Z","updated_at":"2015-10-07T15:56:43Z","html_url":"https://github.com/smashingboxes/guides/pull/3#discussion_r41408431","pull_request_url":"https://api.github.com/repos/smashingboxes/guides/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/smashingboxes/guides/pulls/comments/41408431"},"html":{"href":"https://github.com/smashingboxes/guides/pull/3#discussion_r41408431"},"pull_request":{"href":"https://api.github.com/repos/smashingboxes/guides/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/smashingboxes/guides/pulls/3","id":46928585,"html_url":"https://github.com/smashingboxes/guides/pull/3","diff_url":"https://github.com/smashingboxes/guides/pull/3.diff","patch_url":"https://github.com/smashingboxes/guides/pull/3.patch","issue_url":"https://api.github.com/repos/smashingboxes/guides/issues/3","number":3,"state":"open","locked":false,"title":"First draft at a cucumber guide","user":{"login":"dkniffin","id":1680080,"avatar_url":"https://avatars.githubusercontent.com/u/1680080?v=3","gravatar_id":"","url":"https://api.github.com/users/dkniffin","html_url":"https://github.com/dkniffin","followers_url":"https://api.github.com/users/dkniffin/followers","following_url":"https://api.github.com/users/dkniffin/following{/other_user}","gists_url":"https://api.github.com/users/dkniffin/gists{/gist_id}","starred_url":"https://api.github.com/users/dkniffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkniffin/subscriptions","organizations_url":"https://api.github.com/users/dkniffin/orgs","repos_url":"https://api.github.com/users/dkniffin/repos","events_url":"https://api.github.com/users/dkniffin/events{/privacy}","received_events_url":"https://api.github.com/users/dkniffin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-06T16:52:30Z","updated_at":"2015-10-07T15:56:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4f8d3ab17f7484dd38784747b14361ae6f08e47","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/smashingboxes/guides/pulls/3/commits","review_comments_url":"https://api.github.com/repos/smashingboxes/guides/pulls/3/comments","review_comment_url":"https://api.github.com/repos/smashingboxes/guides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smashingboxes/guides/issues/3/comments","statuses_url":"https://api.github.com/repos/smashingboxes/guides/statuses/8e675e5e31ffc835130f49efec37356456a13733","head":{"label":"smashingboxes:feature/cucumber-guide","ref":"feature/cucumber-guide","sha":"8e675e5e31ffc835130f49efec37356456a13733","user":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"repo":{"id":40675959,"name":"guides","full_name":"smashingboxes/guides","owner":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smashingboxes/guides","description":"A collaborative place for developer guides to be created before being added to the wiki.","fork":false,"url":"https://api.github.com/repos/smashingboxes/guides","forks_url":"https://api.github.com/repos/smashingboxes/guides/forks","keys_url":"https://api.github.com/repos/smashingboxes/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smashingboxes/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smashingboxes/guides/teams","hooks_url":"https://api.github.com/repos/smashingboxes/guides/hooks","issue_events_url":"https://api.github.com/repos/smashingboxes/guides/issues/events{/number}","events_url":"https://api.github.com/repos/smashingboxes/guides/events","assignees_url":"https://api.github.com/repos/smashingboxes/guides/assignees{/user}","branches_url":"https://api.github.com/repos/smashingboxes/guides/branches{/branch}","tags_url":"https://api.github.com/repos/smashingboxes/guides/tags","blobs_url":"https://api.github.com/repos/smashingboxes/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smashingboxes/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smashingboxes/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/smashingboxes/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smashingboxes/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/smashingboxes/guides/languages","stargazers_url":"https://api.github.com/repos/smashingboxes/guides/stargazers","contributors_url":"https://api.github.com/repos/smashingboxes/guides/contributors","subscribers_url":"https://api.github.com/repos/smashingboxes/guides/subscribers","subscription_url":"https://api.github.com/repos/smashingboxes/guides/subscription","commits_url":"https://api.github.com/repos/smashingboxes/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/smashingboxes/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/smashingboxes/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/smashingboxes/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/smashingboxes/guides/contents/{+path}","compare_url":"https://api.github.com/repos/smashingboxes/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smashingboxes/guides/merges","archive_url":"https://api.github.com/repos/smashingboxes/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smashingboxes/guides/downloads","issues_url":"https://api.github.com/repos/smashingboxes/guides/issues{/number}","pulls_url":"https://api.github.com/repos/smashingboxes/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/smashingboxes/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/smashingboxes/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smashingboxes/guides/labels{/name}","releases_url":"https://api.github.com/repos/smashingboxes/guides/releases{/id}","created_at":"2015-08-13T18:46:39Z","updated_at":"2015-08-13T19:13:18Z","pushed_at":"2015-10-06T16:52:31Z","git_url":"git://github.com/smashingboxes/guides.git","ssh_url":"git@github.com:smashingboxes/guides.git","clone_url":"https://github.com/smashingboxes/guides.git","svn_url":"https://github.com/smashingboxes/guides","homepage":"http://wiki.smashingboxes.com","size":212,"stargazers_count":0,"watchers_count":0,"language":null,"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":"smashingboxes:master","ref":"master","sha":"275dfeff45088dd10d09fd959e53d1d38f1aa3fd","user":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"repo":{"id":40675959,"name":"guides","full_name":"smashingboxes/guides","owner":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smashingboxes/guides","description":"A collaborative place for developer guides to be created before being added to the wiki.","fork":false,"url":"https://api.github.com/repos/smashingboxes/guides","forks_url":"https://api.github.com/repos/smashingboxes/guides/forks","keys_url":"https://api.github.com/repos/smashingboxes/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smashingboxes/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smashingboxes/guides/teams","hooks_url":"https://api.github.com/repos/smashingboxes/guides/hooks","issue_events_url":"https://api.github.com/repos/smashingboxes/guides/issues/events{/number}","events_url":"https://api.github.com/repos/smashingboxes/guides/events","assignees_url":"https://api.github.com/repos/smashingboxes/guides/assignees{/user}","branches_url":"https://api.github.com/repos/smashingboxes/guides/branches{/branch}","tags_url":"https://api.github.com/repos/smashingboxes/guides/tags","blobs_url":"https://api.github.com/repos/smashingboxes/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smashingboxes/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smashingboxes/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/smashingboxes/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smashingboxes/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/smashingboxes/guides/languages","stargazers_url":"https://api.github.com/repos/smashingboxes/guides/stargazers","contributors_url":"https://api.github.com/repos/smashingboxes/guides/contributors","subscribers_url":"https://api.github.com/repos/smashingboxes/guides/subscribers","subscription_url":"https://api.github.com/repos/smashingboxes/guides/subscription","commits_url":"https://api.github.com/repos/smashingboxes/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/smashingboxes/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/smashingboxes/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/smashingboxes/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/smashingboxes/guides/contents/{+path}","compare_url":"https://api.github.com/repos/smashingboxes/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smashingboxes/guides/merges","archive_url":"https://api.github.com/repos/smashingboxes/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smashingboxes/guides/downloads","issues_url":"https://api.github.com/repos/smashingboxes/guides/issues{/number}","pulls_url":"https://api.github.com/repos/smashingboxes/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/smashingboxes/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/smashingboxes/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smashingboxes/guides/labels{/name}","releases_url":"https://api.github.com/repos/smashingboxes/guides/releases{/id}","created_at":"2015-08-13T18:46:39Z","updated_at":"2015-08-13T19:13:18Z","pushed_at":"2015-10-06T16:52:31Z","git_url":"git://github.com/smashingboxes/guides.git","ssh_url":"git@github.com:smashingboxes/guides.git","clone_url":"https://github.com/smashingboxes/guides.git","svn_url":"https://github.com/smashingboxes/guides","homepage":"http://wiki.smashingboxes.com","size":212,"stargazers_count":0,"watchers_count":0,"language":null,"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/smashingboxes/guides/pulls/3"},"html":{"href":"https://github.com/smashingboxes/guides/pull/3"},"issue":{"href":"https://api.github.com/repos/smashingboxes/guides/issues/3"},"comments":{"href":"https://api.github.com/repos/smashingboxes/guides/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/smashingboxes/guides/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/smashingboxes/guides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smashingboxes/guides/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/smashingboxes/guides/statuses/8e675e5e31ffc835130f49efec37356456a13733"}}}}