Sha256: 951e72352e0a867c96779812fa04f867e1c07e0f09a13518fde99df035772bc9

Contents?: true

Size: 1 KB

Versions: 11

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

require "spec_helper"

describe "Sessions", type: :feature do
  let!(:admin) do
    create(:admin, email: "admin@example.org",
                   password: "123456",
                   password_confirmation: "123456")
  end

  before(:each) do
    visit decidim_system.root_path
  end

  context "when using a correct username and password" do
    it "lets you into the system panel" do
      within ".new_admin" do
        fill_in :admin_email, with: "admin@example.org"
        fill_in :admin_password, with: "123456"
        find("*[type=submit]").click
      end

      expect(page).to have_content("Dashboard")
    end
  end

  context "when using an incorrect username and password" do
    it "doesn't let you in the admin panel" do
      within ".new_admin" do
        fill_in :admin_email, with: "admin@example.org"
        fill_in :admin_password, with: "forged_password"
        find("*[type=submit]").click
      end

      expect(page).to have_no_content("Dashboard")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.7 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.6 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.5 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.4 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.3 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.2 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.1 decidim-system/spec/features/sessions_spec.rb
decidim-0.6.0 decidim-system/spec/features/sessions_spec.rb
decidim-0.5.1 decidim-system/spec/features/sessions_spec.rb
decidim-0.5.0 decidim-system/spec/features/sessions_spec.rb