mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-04 20:22:47 -05:00
* Remove unused bluecloth gem Last released in 2011. It was only required, never called; kramdown renders the markdown. * Add specs for Tilt markdown rendering and posts markdown partial * Remove rails_12factor gem Last released in 2014. Rails 5+ does this via RAILS_SERVE_STATIC_FILES and RAILS_LOG_TO_STDOUT, which production.rb already reads. * Remove memcachier gem from Gemfile and Gemfile.lock * Remove unused webrat gem Last released in 2011. Nothing requires it; the specs use Rails' assert_select and Capybara matchers. Only generator comments mention it. * Remove crowdin-cli gem Last released in 2018. Crowdin now ships its own standalone CLI, which reads crowdin.yml and doesn't need the gem. Also drops the dependencies only it used (rest-client, gli, crowdin-api and friends). * Removes the crowdin-cli gem (last released 2018), the dependencies only it needed, and crowdin.yml. Crowdin was never set up: the config still has a placeholder project ID and nothing else in the repo mentions it. Assisted by Claude * Remove newsletter functionality and associated views and tests * Remove newsletter functionality and related code across the application * keep the column * Remove stale test step * add back newsletter * Add migration to update newsletter column comment in members table --------- Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
84 lines
2.1 KiB
Ruby
84 lines
2.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe 'devise/registrations/edit.html.haml', type: "view" do
|
|
context "logged in" do
|
|
before do
|
|
controller.stub(:current_user) { nil }
|
|
@member = create(:member)
|
|
controller.stub(:current_member) { @member }
|
|
@view.stub(:resource).and_return(@member)
|
|
@view.stub(:resource_name).and_return("member")
|
|
@view.stub(:resource_class).and_return(Member)
|
|
@view.stub(:devise_mapping).and_return(Devise.mappings[:member])
|
|
end
|
|
|
|
it 'has some fields' do
|
|
render
|
|
expect(rendered).to have_content 'Email'
|
|
end
|
|
|
|
context 'email section' do
|
|
before do
|
|
render
|
|
end
|
|
|
|
it 'has a checkbox for email notifications' do
|
|
assert_select "input[id=member_send_notification_email][type=checkbox]"
|
|
end
|
|
end
|
|
|
|
context 'profile section' do
|
|
before do
|
|
render
|
|
end
|
|
|
|
it 'shows show_email checkbox' do
|
|
assert_select "input[id=member_show_email][type=checkbox]"
|
|
end
|
|
|
|
it "contains a gravatar icon" do
|
|
assert_select "img", src: %r{gravatar\.com/avatar}
|
|
end
|
|
|
|
it 'contains a link to gravatar.com' do
|
|
assert_select "a", href: /gravatar\.com/
|
|
end
|
|
|
|
it 'shows bio field' do
|
|
assert_select "textarea[id=member_bio]"
|
|
end
|
|
|
|
it 'shows location field' do
|
|
assert_select "input[id=member_location][type=text]"
|
|
end
|
|
end
|
|
|
|
context 'other sites section' do
|
|
context 'not connected to flickr' do
|
|
it 'has a link to connect' do
|
|
render
|
|
assert_select "a", "Connect to Flickr"
|
|
end
|
|
end
|
|
|
|
context 'connected to flickr' do
|
|
before do
|
|
@flickr_auth = create(:flickr_authentication, member: @member)
|
|
render
|
|
end
|
|
|
|
it 'has a link to flickr photostream' do
|
|
assert_select "a", href: "http://flickr.com/photos/#{@flickr_auth.uid}"
|
|
end
|
|
|
|
it 'has a link to disconnect' do
|
|
render
|
|
assert_select "a", href: @flickr_auth, text: "Disconnect"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|