Sha256: ac4cc08d658dcea5d2b85f2557fd99e0fb7126873a6b74585eccf644afa4771b

Contents?: true

Size: 522 Bytes

Versions: 50

Compression:

Stored size: 522 Bytes

Contents

require 'rails_helper'
describe Api::V1::NotesController , type: :controller do

  before do
    create_and_sign_in_user
    post :create , params: { :body => 'test_body', :title => 'test_title', :user => User.first}
  end

  it 'returns the title' do
    expect(JSON.parse(@response.body)['title']).to eq('test_title')
  end
  it 'returns the body' do
    expect(JSON.parse(@response.body)['body']).to eq('test_body')
  end

  it 'returns a created status' do
    expect(response).to have_http_status(:created)
  end
end

Version data entries

50 entries across 47 versions & 4 rubygems

Version Path
jinda-0.8.0 test/dummy/spec/controllers/api/v1_post_spec.rb
jinda-0.8.0 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.4 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.4 test/dummy/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.3 test/dummy/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.3 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.2 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7.1 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda_mind-1.0.0 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.7 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.6 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.5.5 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.5.4 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.5.3 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.5.2 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.5.0 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.3 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.2 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.1 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
jinda-0.7.0.4 lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb