diff options
Diffstat (limited to 'spec/helpers/clusters_helper_spec.rb')
-rw-r--r-- | spec/helpers/clusters_helper_spec.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/spec/helpers/clusters_helper_spec.rb b/spec/helpers/clusters_helper_spec.rb deleted file mode 100644 index 459fdfdc5a4..00000000000 --- a/spec/helpers/clusters_helper_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'spec_helper' - -describe ClustersHelper do - let(:cluster) { create(:cluster) } - - describe '.can_toggle_cluster' do - let(:user) { create(:user) } - - before do - allow(helper).to receive(:current_user).and_return(user) - end - - subject { helper.can_toggle_cluster?(cluster) } - - context 'when user can update' do - before do - allow(helper).to receive(:can?).with(any_args).and_return(true) - end - - context 'when cluster is created' do - before do - allow(cluster).to receive(:created?).and_return(true) - end - - it { is_expected.to eq(true) } - end - - context 'when cluster is not created' do - before do - allow(cluster).to receive(:created?).and_return(false) - end - - it { is_expected.to eq(false) } - end - end - - context 'when user can not update' do - before do - allow(helper).to receive(:can?).with(any_args).and_return(false) - end - - it { is_expected.to eq(false) } - end - end -end |