AudioUploadBox extends BaseView { @Override protected void initialize() throws JSONException { super.initialize(); if (model.getRecordedAudio() != null) { enableButton(findViewById(R.id.play_record), R.drawable.play_active); } } AudioUploadBox(Context context);  AudioUploadBox(Context context, AttributeSet attrs); @Override void setEnabled(boolean enabled);  }
@Test public void shouldEnablePlayButtonIfThereIsAnAudioFileAvailableForGivenUser(){ Child givenChild = new Child(); givenChild.put(field.getId(), "some_audio_file"); view.initialize(field, givenChild); Button play = (Button) view.findViewById(R.id.play_record); assertEquals(VISIBLE, play.getVisibility()); }