New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests #388

Merged
merged 4 commits into from Jun 6, 2017

Conversation

Projects
None yet
3 participants
@gedankenstuecke
Copy link
Member

gedankenstuecke commented Jun 6, 2017

Added tests for

  • JSON SNP-API
  • Arriving on openSNP as
    • not logged in user
    • logged in user
  • Sending password reset emails

Drives the test coverage up at least a bit.

gedankenstuecke added some commits Jun 6, 2017

%w(name id genotypes).each do |property|
expect(data["user"].keys).to include(property)
end

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Extra empty line detected at block body end.

expect(data["snp"].keys).to include(property)
end
%w(name id genotypes).each do |property|
expect(data["user"].keys).to include(property)

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Prefer single-quoted strings when you don't need string interpolation or special symbols.

expect(data).to_not be_empty
data = data[0]
%w(name chromosome position).each do |property|
expect(data["snp"].keys).to include(property)

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Prefer single-quoted strings when you don't need string interpolation or special symbols.

create(:snp, name: 'rs1234')
create(:user) { create(:user, name: 'API-Hacker') }
create(:user_snp) {create(:user_snp,user: User.first,snp: Snp.first)}
get "/snps/rs1234.json"

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Prefer single-quoted strings when you don't need string interpolation or special symbols.

it 'GET /snps/:id.json' do
create(:snp, name: 'rs1234')
create(:user) { create(:user, name: 'API-Hacker') }
create(:user_snp) {create(:user_snp,user: User.first,snp: Snp.first)}

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Space missing inside {.
Space missing after comma.
Space missing inside }.

@@ -0,0 +1,22 @@
# frozen_string_literal: true
require 'spec_helper'

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Add an empty line after magic comments.

@@ -0,0 +1,40 @@
RSpec.describe 'Arriving at openSNP' do
let!(:user) { create(:user, name: 'Potato Bill', email: 'potato@example.com')}
let!(:phenotype) {create(:phenotype, characteristic: 'Eye color')}

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Space missing inside {.
Space missing inside }.

@@ -0,0 +1,40 @@
RSpec.describe 'Arriving at openSNP' do
let!(:user) { create(:user, name: 'Potato Bill', email: 'potato@example.com')}

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Space missing inside }.

@@ -0,0 +1,40 @@
RSpec.describe 'Arriving at openSNP' do

This comment has been minimized.

@houndci-bot

houndci-bot Jun 6, 2017

Collaborator

Block has too many lines. [34/25]
Missing magic comment # frozen_string_literal: true.

gedankenstuecke and others added some commits Jun 6, 2017

@tsujigiri
Copy link
Collaborator

tsujigiri left a comment

😍

@gedankenstuecke gedankenstuecke merged commit ef83c4b into master Jun 6, 2017

5 checks passed

codeclimate no new or fixed issues
Details
codeclimate/coverage 75.53% (+1.2%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
hound No violations found. Woof!
@tsujigiri

This comment has been minimized.

Copy link
Collaborator

tsujigiri commented Jun 6, 2017

The test coverage thingy works great now! Love it!

@gedankenstuecke gedankenstuecke deleted the new_tests branch Jun 6, 2017

@gedankenstuecke

This comment has been minimized.

Copy link
Member

gedankenstuecke commented Jun 6, 2017

Yep, that's pretty cool! And I think I'm slowly getting the hang of writing tests. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment