Skip to content

Commit

Permalink
Merge f8d8089 into d0f6a7f
Browse files Browse the repository at this point in the history
  • Loading branch information
svbergerem committed Jul 9, 2016
2 parents d0f6a7f + f8d8089 commit ff85bf5
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 21 deletions.
7 changes: 0 additions & 7 deletions app/helpers/contacts_helper.rb
@@ -1,11 +1,4 @@
module ContactsHelper
def contact_aspect_dropdown(contact)
render :partial => 'people/relationship_action',
:locals => { :person => contact.person,
:contact => contact,
:current_user => current_user }
end

def start_a_conversation_link(aspect, contacts_size)
conv_opts = { class: "conversation_button contacts_button"}

Expand Down
12 changes: 0 additions & 12 deletions app/helpers/getting_started_helper.rb
Expand Up @@ -7,16 +7,4 @@ module GettingStartedHelper
def has_completed_getting_started?
current_user.getting_started == false
end

def tag_link(tag_name)
if tag_followed?(tag_name)
link_to "##{tag_name}", tag_followings_path(tag_name), :method => :delete, :class => "featured_tag followed"
else
link_to "##{tag_name}", tag_tag_followings_path(tag_name), :method => :post, :class => "featured_tag"
end
end

def tag_followed?(tag_name)
tags.detect{|t| t.name == tag_name}
end
end
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -220,7 +220,7 @@
get "statistics", to: "node_info#statistics"

# Terms
if AppConfig.settings.terms.enable?
if AppConfig.settings.terms.enable? || Rails.env.test?
get 'terms' => 'terms#index'
end

Expand Down
25 changes: 24 additions & 1 deletion spec/controllers/admins_controller_spec.rb
Expand Up @@ -86,6 +86,12 @@
expect(response).to redirect_to user_search_path
expect(flash.notice).to include("invitation sent")
end

it "doesn't invite an existing user" do
get :admin_inviter, identifier: bob.email
expect(response).to redirect_to user_search_path
expect(flash.notice).to include("error sending invite")
end
end
end

Expand All @@ -94,10 +100,27 @@
Role.add_admin(@user.person)
end

it 'succeeds and renders stats' do
it "succeeds and renders stats" do
get :stats
expect(response).to be_success
expect(response).to render_template(:stats)
expect(response.body).to include(
I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily"))
)
end

it "succeeds and renders stats for different ranges" do
%w(week 2weeks month).each do |range|
get :stats, range: range
expect(response).to be_success
expect(response).to render_template(:stats)
expect(response.body).not_to include(
I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily"))
)
expect(response.body).to include(
I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.#{range}"))
)
end
end
end
end
16 changes: 16 additions & 0 deletions spec/controllers/help_controller_spec.rb
@@ -0,0 +1,16 @@
require "spec_helper"

describe HelpController, type: :controller do
describe "#faq" do
it "succeeds" do
get :faq
expect(response).to be_success
end

it "fails on mobile" do
expect {
get :faq, format: :mobile
}.to raise_error ActionView::MissingTemplate
end
end
end
15 changes: 15 additions & 0 deletions spec/controllers/terms_controller_spec.rb
@@ -0,0 +1,15 @@
require "spec_helper"

describe TermsController, type: :controller do
describe "#index" do
it "succeeds" do
get :index
expect(response).to be_success
end

it "succeeds on mobile" do
get :index, format: :mobile
expect(response).to be_success
end
end
end

0 comments on commit ff85bf5

Please sign in to comment.