From 6c7f6677ba2accf608df24e5a5050bdd2e99b112 Mon Sep 17 00:00:00 2001 From: Peter Bhat Harkins Date: Thu, 19 Apr 2018 05:34:47 -0500 Subject: [PATCH] housekeeping If you don't want color in rspec output, you can add it to your ~/.rspec. --- .github/ISSUE_TEMPLATE.md | 4 ---- .github/issue_template.md | 7 +++++++ .github/pull_request_template.md | 3 +++ .rspec | 1 - CONTRIBUTING.md | 6 +++--- README.md | 5 +++-- spec/models/story_spec.rb | 18 ++++++++++++------ 7 files changed, 28 insertions(+), 16 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/issue_template.md create mode 100644 .github/pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index ad322f0c..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 00000000..18f04511 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,7 @@ + + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..8625a607 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,3 @@ + diff --git a/.rspec b/.rspec index 3bbc6f45..c99d2e73 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1 @@ ---no-colour --require spec_helper diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 77423806..f2089a81 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ to avoid wasted efforts. * (Optional) Create a branch to house your changes. -* Wrap code at 80 characters with 2-space soft tabs for Ruby code. For other +* Run `bundle exec rubocop` to check the style of your Ruby. For other languages, use the existing style of the files being edited. 3rd party, externally-maintained code such as Javascript libraries can remain in their own style. @@ -42,8 +42,8 @@ present-tense explanation of the change. Wrap all lines at 80 characters. * If applicable, add tests for your changes. Not all changes require tests, and tests should not be added just for the sake of code coverage. -* Run _all_ tests (with `rake` in the root directory) to ensure nothing has -been broken by your changes. +* Run _all_ tests (with `bundle exec rspec` in the root directory) to ensure +nothing has been broken by your changes. ### Submitting Changes diff --git a/README.md b/README.md index bc11f26a..2453a32f 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,9 @@ file. #### Initial setup -Use the steps below for a local install or consider the external -project [docker-lobsters](https://github.com/jamesbrink/docker-lobsters). +Use the steps below for a local install or +[lobsters-ansible](https://github.com/lobsters/lobsters-ansible) for our production deployment config. +There's an external project [docker-lobsters](https://github.com/jamesbrink/docker-lobsters) if you want to use Docker. * Install Ruby 2.3. diff --git a/spec/models/story_spec.rb b/spec/models/story_spec.rb index d8e62ae0..1d1a59e5 100644 --- a/spec/models/story_spec.rb +++ b/spec/models/story_spec.rb @@ -75,12 +75,18 @@ describe Story do end it "parses domain properly" do - expect(Story.new(url: "http://example.com").domain).to eq("example.com") - expect(Story.new(url: "https://example.com").domain).to eq("example.com") - expect(Story.new(url: "http://example.com:8000").domain).to eq("example.com") - expect(Story.new(url: "http://example.com:8000/").domain).to eq("example.com") - expect(Story.new(url: "http://www3.example.com/goose").domain).to eq("example.com") - expect(Story.new(url: "http://flub.example.com").domain).to eq("flub.example.com") + story = Story.new + { + "http://example.com": "example.com", + "https://example.com": "example.com", + "http://example.com:8000": "example.com", + "http://example.com:8000/": "example.com", + "http://www3.example.com/goose": "example.com", + "http://flub.example.com": "flub.example.com", + }.each_pair do |url, domain| + story.url = url + expect(story.domain).to eq(domain) + end end it "converts a title to a url properly" do