Sha256: 75d1d575f19583caecaaf8c5b3142a21e94a8797a50ee141ae84667e5252e880

Contents?: true

Size: 745 Bytes

Versions: 8

Compression:

Stored size: 745 Bytes

Contents

require 'spec_helper'

describe 'users/index.html.erb' do

  let(:join_date) { 5.days.ago }
  before do
    users = []
    (1..25).each  {|i| users << stub_model(User, name: "name#{i}", user_key: "user#{i}", created_at: join_date)}
    User.stub_chain(:all).and_return(users)
    relation = User.all
    allow(relation).to receive(:limit_value).and_return(10)
    allow(relation).to receive(:current_page).and_return(1)
    allow(relation).to receive(:total_pages).and_return(3)
    assign(:users, relation)
  end

  it "should draw user list" do
    render
    page = Capybara::Node::Simple.new(rendered)
    expect(page).to have_content("Sufia Users")
    (1..10).each  do |i|
      expect(page).to have_content("user#{i}")
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-4.0.1 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.rc2 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.rc1 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.beta4 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.beta3 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.beta2 spec/views/users/index.html.erb_spec.rb
sufia-4.0.0.beta1 spec/views/users/index.html.erb_spec.rb