Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant access messaging functionality to test before login works #51

Open
emtalen opened this issue Feb 13, 2020 · 0 comments
Open

Cant access messaging functionality to test before login works #51

emtalen opened this issue Feb 13, 2020 · 0 comments

Comments

@emtalen
Copy link

emtalen commented Feb 13, 2020

Problem

We are trying to test the functionality of sending a message and we are using the Factorybot but the bot can't log in and then we do not know how to have access to the message functionality.
Should we change direction and figure out what the problem with logging in is, or is there another way to get around it?

Background

We split up to two teams were one team is working on the signup and we were suppose to create the factorybot and log in to test the messages functions.

Story

Please add a story if applicable

As a User,
In order to send an email
I would like to be able to create it

Spec

We have modified the spec to first see that the login was successful as we expected.

feature 'User can' do
        before do
            visit user_session_path
            fill_in "user_email", with: "[email protected]"
            fill_in "user_password", with: "12345678"
            click_on "Log in"
        end
        
    it 'create an email' do
        expect(page).to have_content "Hello Name"
        # click_on 'Inbox'
        # click_on 'Compose'
        # # choose '#'
        # fill_in 'Subject', with: 'Hello'
        # fill_in 'Message', with: 'Test Message'
        # click_on "Send Message"

    end 
end

Implementation code

#spec/factories/user_bot.rb
FactoryBot.define do
    factory :user do
        name { "Name" }
        email { "[email protected]" }
        password { "12345678" }
    end
end


#spec/model/user_spec.rb
require 'rails_helper'

RSpec.describe User, type: :model do
    describe 'DB table' do
        it { is_expected.to have_db_column :name }
    end

    describe 'Validations' do
        it { is_expected.to validate_presence_of :name }
    end

    describe 'Factory' do
        it 'should have valid Factory' do
            expect(FactoryBot.create(:user)).to be_valid
        end
    end
end

Screenshots

How did you try to solve the problem?

Write the steps you took to try to fix the problem here

Markdown guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant