Sha256: b15131206c9111a490e076686e3884c83255185aa7784c2da74e3ecd2d511d77

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

require 'rails_helper'

describe 'releases#index' do

  it 'should return found' do
    admin_login
    get admin_releases_path

    expect(response.status).to eq(200)
  end

end

describe 'releases#new' do

  it 'should return found' do
    admin_login
    get new_admin_release_path

    expect(response.status).to eq(200)
  end

end

describe 'releases#edit' do

  it 'should return found' do
    release = FactoryGirl.create(:release)
    admin_login
    get edit_admin_release_path(release)

    expect(response.status).to eq(200)
  end

end

describe 'releases#create' do

  context 'when from_existing' do

    it 'should clone original item' do
      release = FactoryGirl.create(:release, name: 'short')
      admin_login
      post admin_releases_path(from_existing: release.id)

      expect(Release.all.collect(&:name)).to eq(['short', 'short-2'])
    end

    it 'should modify cloned items name if length validation is triggered' do
      release = FactoryGirl.create(:release, name: 'hey a long name')
      admin_login
      post admin_releases_path(from_existing: release.id)

      expect(Release.all.collect(&:name)).to eq(['hey a long name', 'hey a long na-2'])
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fae-rails-1.6.0 spec/requests/releases_spec.rb
fae-rails-1.5.1 spec/requests/releases_spec.rb
fae-rails-1.5.0 spec/requests/releases_spec.rb
fae-rails-1.4.1 spec/requests/releases_spec.rb
fae-rails-1.4.0 spec/requests/releases_spec.rb
fae-rails-1.3.1 spec/requests/releases_spec.rb
fae-rails-1.3.0 spec/requests/releases_spec.rb
fae-rails-1.2.5 spec/requests/releases_spec.rb
fae-rails-1.2.4 spec/requests/releases_spec.rb
fae-rails-1.2.3 spec/requests/releases_spec.rb
fae-rails-1.2.2 spec/requests/releases_spec.rb