Sha256: c437dc761db52336baa61b24f35a2c4e042ecedd2f786eace10e1b8e5b5ea3bc

Contents?: true

Size: 829 Bytes

Versions: 6

Compression:

Stored size: 829 Bytes

Contents

# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'phases/index', type: :view do
  let(:user) { FactoryGirl.create(:user) }
  let(:project) { FactoryGirl.create(:project, owner: user) }
  before(:each) do
    assign(:phases, [
             FactoryGirl.create(:phase, project: project, name: 'phase1'),
             FactoryGirl.create(:phase, project: project, name: 'phase2'),
           ])
  end

  it 'renders a list of phases' do
    render
    assert_select 'tr>td', text: 'project1', count: 2
    assert_select 'tr>td', text: 'phase1', count: 1
    assert_select 'tr>td', text: 'phase2', count: 1
    assert_select 'tr>td', text: localize(Time.zone.parse('2020-01-29 02:50:00 +09:00')), count: 2
    assert_select 'tr>td', text: localize(Time.zone.parse('2020-01-29 16:40:00 +09:00')), count: 2
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
model_base_generators-0.3.9 example/spec/views/phases/index.html.erb_spec.rb
model_base_generators-0.3.8 example/spec/views/phases/index.html.erb_spec.rb
model_base_generators-0.3.7 example/spec/views/phases/index.html.erb_spec.rb
model_base_generators-0.3.6 example/spec/views/phases/index.html.erb_spec.rb
model_base_generators-0.3.5 example/spec/views/phases/index.html.erb_spec.rb
model_base_generators-0.3.4 example/spec/views/phases/index.html.erb_spec.rb