This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rspec spec/models/article_spec.rb | |
| F | |
| Failures: | |
| 1) Article.published only returns published articles | |
| Failure/Error: @published.should_not be_empty | |
| NoMethodError: | |
| undefined method `empty?' for nil:NilClass | |
| # ./spec/models/article_spec.rb:13:in `block (3 levels) in <top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Article < ActiveRecord::Base | |
| def self.published | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rspec spec/models/article_spec.rb | |
| F | |
| Failures: | |
| 1) Article.published only returns published articles | |
| Failure/Error: @published = Article.published | |
| NoMethodError: | |
| undefined method `published' for #<Class:0x007fee85f72440> | |
| # ./spec/models/article_spec.rb:9:in `block (3 levels) in <top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe Article do | |
| describe '.published' do | |
| before do | |
| FactoryGirl.create_list(:published_article, 2) | |
| FactoryGirl.create_list(:unpublished_article, 1) | |
| @published = Article.published | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cucumber features/api/v1/articles.feature | |
| Using the default profile... | |
| ..F- | |
| (::) failed steps (::) | |
| undefined method `published' for #<Class:0x007ff13c529498> | |
| (NoMethodError) | |
| ./app/controllers/api/v1/articles_controller.rb:3:in `index' | |
| ./features/step_definitions/api/v1/articles_steps.rb:11:in `/^I ask for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Api::V1::ArticlesController < ApplicationController | |
| def index | |
| @articles = Article.published | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cucumber features/api/v1/articles.feature | |
| Using the default profile... | |
| ..F- | |
| (::) failed steps (::) | |
| undefined method `empty?' for nil:NilClass (ActionView::Template::Error) | |
| Failing Scenarios: | |
| cucumber features/api/v1/articles.feature:6 # Scenario: Get articles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| json.array! @articles do |json, article| | |
| json.title article.title | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ touch app/views/api/v1/articles/index.json.jbuilder | |
| $ cucumber features/api/v1/articles.feature | |
| Using the default profile... | |
| ...F | |
| (::) failed steps (::) | |
| expected 3 published_articles, got 0 | |
| (RSpec::Expectations::ExpectationNotMetError) | |
| ./features/step_definitions/api/v1/articles_steps.rb:16:in `/^I should |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cucumber features/api/v1/articles.feature | |
| Using the default profile... | |
| ..F- | |
| (::) failed steps (::) | |
| Missing template api/v1/articles/index, application/index with | |
| {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, | |
| :jbuilder, :coffee]}. Searched in: | |
| * "/Users/jared/Projects/sample/app/views" |