Sha256: 861776de3de875fd1ff417d95a99a561bcddb445dd57655c81f480d7f58fac51

Contents?: true

Size: 1 KB

Versions: 16

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).not_to have_content("Dashboard")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-0.1.0 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.8.1 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.7 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.6 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.5 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.4 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.3 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.2 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha9 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha8 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha7 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha6 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha5 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha4 decidim-system/spec/features/sessions_spec.rb
decidim-0.0.1.alpha3 decidim-system/spec/features/sessions_spec.rb